Skip to content

Commit b86884b

Browse files
authored
[BugFix] Fix exception not clear in env (backport #54645) (backport #54662) (#54798)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
1 parent 54781dd commit b86884b

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

be/src/udf/java/java_udf.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,12 @@ class JVMFunctionHelper {
217217
env->ExceptionClear(); \
218218
}
219219

220-
#define RETURN_ERROR_IF_JNI_EXCEPTION(env) \
221-
if (auto e = env->ExceptionOccurred()) { \
222-
LOCAL_REF_GUARD(e); \
223-
std::string msg = JVMFunctionHelper::getInstance().dumpExceptionString(e); \
224-
return Status::InternalError(JVMFunctionHelper::getInstance().dumpExceptionString(e)); \
220+
#define RETURN_ERROR_IF_JNI_EXCEPTION(env) \
221+
if (auto e = env->ExceptionOccurred()) { \
222+
LOCAL_REF_GUARD(e); \
223+
std::string msg = JVMFunctionHelper::getInstance().dumpExceptionString(e); \
224+
env->ExceptionClear(); \
225+
return Status::InternalError(msg); \
225226
}
226227

227228
// Used for UDAF serialization and deserialization,

0 commit comments

Comments
 (0)