1 /* Copyright (c) 2018-2019. 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(simix_context);
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 ForcefulKillException::~ForcefulKillException() = default;
19 void ForcefulKillException::do_throw()
21 throw ForcefulKillException();
24 bool ForcefulKillException::try_n_catch(const std::function<void()>& try_block)
30 } catch (ForcefulKillException const&) {
31 XBT_DEBUG("Caught a ForcefulKillException");
36 } // namespace simgrid