X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/a63a8597fc53411fbb6a812c52f21d4ceede74ee..750ecf3b5990073a757a9535f5227491a271e16a:/src/xbt/exception.cpp diff --git a/src/xbt/exception.cpp b/src/xbt/exception.cpp index 6d9272f0bc..b3f4c51dd8 100644 --- a/src/xbt/exception.cpp +++ b/src/xbt/exception.cpp @@ -70,6 +70,9 @@ const char* xbt_ex_catname(xbt_errcat_t cat) namespace simgrid { namespace xbt { +ImpossibleError::~ImpossibleError() = default; +UnimplementedError::~UnimplementedError() = default; + void log_exception(e_xbt_log_priority_t prio, const char* context, std::exception const& exception) { try { @@ -112,12 +115,12 @@ void log_exception(e_xbt_log_priority_t prio, const char* context, std::exceptio 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; @@ -181,11 +184,11 @@ void xbt_throw_impossible(const char* file, int line, const char* func) { std::stringstream ss; ss << file << ":" << line << ":" << func << ": The Impossible Did Happen (yet again). Please report this bug."; - throw std::runtime_error(ss.str()); + throw simgrid::xbt::ImpossibleError(ss.str()); } void xbt_throw_unimplemented(const char* file, int line, const char* func) { std::stringstream ss; ss << file << ":" << line << ":" << func << ": Feature unimplemented yet. Please report this bug."; - throw std::runtime_error(ss.str()); + throw simgrid::xbt::UnimplementedError(ss.str()); }