Skip to content

Commit e3816ec

Browse files
[BugFix] Fix exception not clear in env (backport #54645) (#54663)
Co-authored-by: stdpain <34912776+stdpain@users.noreply.github.com>
1 parent 18eea51 commit e3816ec

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
@@ -218,11 +218,12 @@ class JVMFunctionHelper {
218218
env->ExceptionClear(); \
219219
}
220220

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

228229
// Used for UDAF serialization and deserialization,

0 commit comments

Comments
 (0)