Skip to content

Commit

Permalink
[BugFix] Fix exception not clear in env (#54645)
Browse files Browse the repository at this point in the history
Signed-off-by: stdpain <[email protected]>
(cherry picked from commit 3b4c347)
  • Loading branch information
stdpain authored and mergify[bot] committed Jan 3, 2025
1 parent 18eea51 commit ab9d18f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions be/src/udf/java/java_udf.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,12 @@ class JVMFunctionHelper {
env->ExceptionClear(); \
}

#define RETURN_ERROR_IF_JNI_EXCEPTION(env) \
if (auto e = env->ExceptionOccurred()) { \
LOCAL_REF_GUARD(e); \
std::string msg = JVMFunctionHelper::getInstance().dumpExceptionString(e); \
return Status::InternalError(JVMFunctionHelper::getInstance().dumpExceptionString(e)); \
#define RETURN_ERROR_IF_JNI_EXCEPTION(env) \
if (auto e = env->ExceptionOccurred()) { \
LOCAL_REF_GUARD(e); \
std::string msg = JVMFunctionHelper::getInstance().dumpExceptionString(e); \
env->ExceptionClear(); \
return Status::InternalError(msg); \
}

// Used for UDAF serialization and deserialization,
Expand Down

0 comments on commit ab9d18f

Please sign in to comment.