[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

View File

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