[JVM Packages] Catch dmlc error by ref. (#5678)

This commit is contained in:
Jiaming Yuan 2020-05-19 13:00:12 +08:00 committed by GitHub
parent 83981a9ce3
commit dd9aeb60ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -151,7 +151,7 @@ XGB_EXTERN_C int XGBoost4jCallbackDataIterNext(
global_jvm->DetachCurrentThread(); global_jvm->DetachCurrentThread();
} }
return ret_value; return ret_value;
} catch(dmlc::Error e) { } catch(dmlc::Error const& e) {
// only detach if it is a async call. // only detach if it is a async call.
if (jni_status == JNI_EDETACHED) { if (jni_status == JNI_EDETACHED) {
global_jvm->DetachCurrentThread(); global_jvm->DetachCurrentThread();