Skip to content

Commit 03b8788

Browse files
committed
Print JVM exception in template method as well
1 parent e2bbae0 commit 03b8788

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

include/jni/errors.hpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@ namespace jni
6060
template < class R >
6161
R CheckJavaException(JNIEnv& env, R&& r)
6262
{
63-
if (env.ExceptionCheck()) throw PendingJavaException();
63+
if (env.ExceptionCheck()) {
64+
env.ExceptionDescribe();
65+
throw PendingJavaException();
66+
}
6467
return std::move(r);
6568
}
6669

0 commit comments

Comments
 (0)