X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/a57f4208147d6350deb00455826fbf8fd6d2f22e..5f7494c30c5435f3e21060a2a91d73b8c2e5f45d:/src/xbt/exception.cpp diff --git a/src/xbt/exception.cpp b/src/xbt/exception.cpp index 4fd03bc71a..73f18098f6 100644 --- a/src/xbt/exception.cpp +++ b/src/xbt/exception.cpp @@ -65,7 +65,6 @@ const char* xbt_ex_catname(xbt_errcat_t cat) default: return "INVALID ERROR"; } - return "INVALID ERROR"; } namespace simgrid { @@ -106,18 +105,19 @@ void log_exception(e_xbt_log_priority_t prio, const char* context, std::exceptio } catch (...) { // Don't log exceptions we got when trying to log exception + XBT_LOG(prio, "Ignoring exception caught while while trying to log an exception!"); } } static void show_backtrace(const simgrid::xbt::Backtrace& bt) { if (simgrid::config::get_value("exception/cutpath")) { - XBT_LOG(xbt_log_priority_critical, "Display of current backtrace disabled by --cfg=exception/cutpath."); + XBT_CRITICAL("Display of current backtrace disabled by --cfg=exception/cutpath."); return; } std::string res = bt.resolve(); - XBT_LOG(xbt_log_priority_critical, "Current backtrace:"); - XBT_LOG(xbt_log_priority_critical, " -> %s", res.c_str()); + XBT_CRITICAL("Current backtrace:"); + XBT_CRITICAL(" -> %s", res.c_str()); } static std::terminate_handler previous_terminate_handler = nullptr; @@ -146,8 +146,9 @@ static void handler() std::abort(); } - catch (simgrid::kernel::context::Context::StopRequest& e) { - XBT_ERROR("Received a StopRequest at the top-level exception handler. Maybe a Java->C++ call that is not protected " + catch (const simgrid::ForcefulKillException&) { + XBT_ERROR("Received a ForcefulKillException at the top-level exception handler. Maybe a Java->C++ call that is not " + "protected " "in a try/catch?"); show_backtrace(bt); } @@ -172,15 +173,6 @@ void install_exception_handler() previous_terminate_handler = std::set_terminate(handler); }); } -// deprecated -void logException(e_xbt_log_priority_t priority, const char* context, std::exception const& exception) -{ - log_exception(priority, context, exception); -} -void installExceptionHandler() -{ - install_exception_handler(); -} } // namespace xbt } // namespace simgrid