diff --git a/core/src/main/java/top/niunaijun/blackreflection/BlackReflection.java b/core/src/main/java/top/niunaijun/blackreflection/BlackReflection.java index a987784..9260a0f 100644 --- a/core/src/main/java/top/niunaijun/blackreflection/BlackReflection.java +++ b/core/src/main/java/top/niunaijun/blackreflection/BlackReflection.java @@ -152,7 +152,11 @@ public Object invoke(Object proxy, Method method, Object[] args) throws Throwabl return call; } catch (Throwable throwable) { if (DEBUG) { - throwable.printStackTrace(); + if (throwable.getCause() != null) { + throwable.getCause().printStackTrace(); + } else { + throwable.printStackTrace(); + } } if (throwable instanceof BlackNullPointerException) { throw new NullPointerException(throwable.getMessage());