diff --git a/be/src/udf/java/java_udf.h b/be/src/udf/java/java_udf.h index 5df5f634db956..a61c7395136d7 100644 --- a/be/src/udf/java/java_udf.h +++ b/be/src/udf/java/java_udf.h @@ -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,