X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d9dde0b9bb9032fdea9a8caa97b5fec79f9ca280..eb87d6215928e722783415af6daf230c1383421a:/src/simgrid/Exception.cpp diff --git a/src/simgrid/Exception.cpp b/src/simgrid/Exception.cpp index add73437f5..9694c6ba59 100644 --- a/src/simgrid/Exception.cpp +++ b/src/simgrid/Exception.cpp @@ -1,17 +1,18 @@ -/* Copyright (c) 2018-2020. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2018-2023. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ #include -XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_context); +XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(ker_actor); namespace simgrid { // DO NOT define destructors for exceptions in Exception.hpp. // Defining it here ensures that the exceptions are defined only in libsimgrid, but not in libsimgrid-java. // Doing otherwise naturally breaks things (at least on freebsd with clang). +// TODO: is it still useful now that Java is gone? Exception::~Exception() = default; TimeoutException::~TimeoutException() = default; @@ -22,6 +23,7 @@ VmFailureException::~VmFailureException() = default; CancelException::~CancelException() = default; TracingError::~TracingError() = default; ParseError::~ParseError() = default; +AssertionError::~AssertionError() = default; ForcefulKillException::~ForcefulKillException() = default; void ForcefulKillException::do_throw() @@ -29,14 +31,14 @@ void ForcefulKillException::do_throw() throw ForcefulKillException(); } -bool ForcefulKillException::try_n_catch(const std::function& try_block) +bool ForcefulKillException::try_n_catch(const std::function& try_block) // XBT_ATTRIB_DEPRECATED_v337 { bool res; try { try_block(); res = true; - } catch (ForcefulKillException const&) { - XBT_DEBUG("Caught a ForcefulKillException"); + } catch (ForcefulKillException const& e) { + XBT_DEBUG("Caught a ForcefulKillException: %s", e.what()); res = false; } return res;