1 /* Copyright (c) 2018-2022. 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).
16 Exception::~Exception() = default;
17 TimeoutException::~TimeoutException() = default;
18 HostFailureException::~HostFailureException() = default;
19 NetworkFailureException::~NetworkFailureException() = default;
20 StorageFailureException::~StorageFailureException() = default;
21 VmFailureException::~VmFailureException() = default;
22 CancelException::~CancelException() = default;
23 TracingError::~TracingError() = default;
24 ParseError::~ParseError() = default;
25 AssertionError::~AssertionError() = default;
26 ForcefulKillException::~ForcefulKillException() = default;
28 void ForcefulKillException::do_throw()
30 throw ForcefulKillException();
33 bool ForcefulKillException::try_n_catch(const std::function<void()>& try_block)
39 } catch (ForcefulKillException const& e) {
40 XBT_DEBUG("Caught a ForcefulKillException: %s", e.what());
45 } // namespace simgrid