From d22e0809a890ce0bc7af8d76c3c504b333d62f49 Mon Sep 17 00:00:00 2001 From: Chen Qin Date: Wed, 16 Oct 2019 10:12:15 -0700 Subject: [PATCH] throw dmlc::Error (#120) * throw dmlc::Error handled by xgboost jni --- include/rabit/internal/utils.h | 5 +++-- include/rabit/serializable.h | 4 ---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/include/rabit/internal/utils.h b/include/rabit/internal/utils.h index 26b401272..05f35557a 100644 --- a/include/rabit/internal/utils.h +++ b/include/rabit/internal/utils.h @@ -13,6 +13,7 @@ #include #include #include +#include "dmlc/io.h" #ifndef RABIT_STRICT_CXX98_ #include @@ -92,7 +93,7 @@ inline void HandleAssertError(const char *msg) { exit(-1); } else { fprintf(stderr, "AssertError:%s, rabit is configured to keep process running\n", msg); - throw std::runtime_error(msg); + throw dmlc::Error(msg); } } /*! @@ -105,7 +106,7 @@ inline void HandleCheckError(const char *msg) { exit(-1); } else { fprintf(stderr, "%s, rabit is configured to keep process running\n", msg); - throw std::runtime_error(msg); + throw dmlc::Error(msg); } } inline void HandlePrint(const char *msg) { diff --git a/include/rabit/serializable.h b/include/rabit/serializable.h index 460e899e8..581262feb 100644 --- a/include/rabit/serializable.h +++ b/include/rabit/serializable.h @@ -10,10 +10,6 @@ #include #include "rabit/internal/utils.h" -#ifndef DMLC_IO_H_ -#include "dmlc/io.h" -#endif // DMLC_IO_H_ - namespace rabit { /*! * \brief defines stream used in rabit