Fix safe_xgboost macro on c++ (#9501)
This commit is contained in:
parent
58530b1bc4
commit
b74802dea9
@ -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()); \
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user