From b74802dea9260c4c12d3b89d10dbbb6abb017856 Mon Sep 17 00:00:00 2001 From: Thomas Zeger Date: Thu, 17 Aug 2023 16:36:06 -0400 Subject: [PATCH] Fix safe_xgboost macro on c++ (#9501) --- doc/tutorials/c_api_tutorial.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/tutorials/c_api_tutorial.rst b/doc/tutorials/c_api_tutorial.rst index 3c33278be..bb1db8249 100644 --- a/doc/tutorials/c_api_tutorial.rst +++ b/doc/tutorials/c_api_tutorial.rst @@ -104,8 +104,8 @@ b. In a C++ application: modify the macro ``safe_xgboost`` to throw an exception #define safe_xgboost(call) { \ int err = (call); \ if (err != 0) { \ - throw new Exception(std::string(__FILE__) + ":" + std::to_string(__LINE__) + \ - ": error in " + #call + ":" + XGBGetLastError())); \ + throw std::runtime_error(std::string(__FILE__) + ":" + std::to_string(__LINE__) + \ + ": error in " + #call + ":" + XGBGetLastError()); \ } \ }