1 /* Copyright (c) 2018-2023. The SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
6 #include <simgrid/Exception.hpp>
8 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(ker_actor);
12 // DO NOT define destructors for exceptions in Exception.hpp.
13 // Defining it here ensures that the exceptions are defined only in libsimgrid, but not in libsimgrid-java.
14 // Doing otherwise naturally breaks things (at least on freebsd with clang).
15 // TODO: is it still useful now that Java is gone?
17 Exception::~Exception() = default;
18 TimeoutException::~TimeoutException() = default;
19 HostFailureException::~HostFailureException() = default;
20 NetworkFailureException::~NetworkFailureException() = default;
21 StorageFailureException::~StorageFailureException() = default;
22 VmFailureException::~VmFailureException() = default;
23 CancelException::~CancelException() = default;
24 TracingError::~TracingError() = default;
25 ParseError::~ParseError() = default;
26 AssertionError::~AssertionError() = default;
27 ForcefulKillException::~ForcefulKillException() = default;
29 void ForcefulKillException::do_throw()
31 throw ForcefulKillException();
34 bool ForcefulKillException::try_n_catch(const std::function<void()>& try_block) // XBT_ATTRIB_DEPRECATED_v337
40 } catch (ForcefulKillException const& e) {
41 XBT_DEBUG("Caught a ForcefulKillException: %s", e.what());
46 } // namespace simgrid