Fix safe_xgboost macro on c++ (#9501)

This commit is contained in:
Thomas Zeger 2023-08-17 16:36:06 -04:00 committed by GitHub
parent 58530b1bc4
commit b74802dea9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -104,8 +104,8 @@ b. In a C++ application: modify the macro ``safe_xgboost`` to throw an exception
#define safe_xgboost(call) { \ #define safe_xgboost(call) { \
int err = (call); \ int err = (call); \
if (err != 0) { \ if (err != 0) { \
throw new Exception(std::string(__FILE__) + ":" + std::to_string(__LINE__) + \ throw std::runtime_error(std::string(__FILE__) + ":" + std::to_string(__LINE__) + \
": error in " + #call + ":" + XGBGetLastError())); \ ": error in " + #call + ":" + XGBGetLastError()); \
} \ } \
} }