// Swapped contexts are broken, starting from pybind11 v2.8.0. Use thread contexts by default.
simgrid::s4u::Engine::set_config("contexts/factory:thread");
- // Internal exception used to kill actors and sweep the RAII chimney (free objects living on the stack)
- static py::object pyForcefulKillEx(py::register_exception<simgrid::ForcefulKillException>(m, "ActorKilled"));
-
py::register_exception<simgrid::NetworkFailureException>(m, "NetworkFailureException");
py::register_exception<simgrid::TimeoutException>(m, "TimeoutException");
-
+ py::register_exception<simgrid::HostFailureException>(m, "HostFailureException");
+ py::register_exception<simgrid::StorageFailureException>(m, "StorageFailureException");
+ py::register_exception<simgrid::VmFailureException>(m, "VmFailureException");
+ py::register_exception<simgrid::CancelException>(m, "CancelException");
+
/* this_actor namespace */
m.def_submodule("this_actor", "Bindings of the s4u::this_actor namespace. See the C++ documentation for details.")
.def(
if (py::isinstance<py::function>(res))
res();
} catch (const py::error_already_set& ex) {
- if (ex.matches(pyForcefulKillEx)) {
- XBT_VERB("Actor killed");
- simgrid::ForcefulKillException::do_throw(); // Forward that ForcefulKill exception
- }
+ XBT_VERB("Actor killed");
+ simgrid::ForcefulKillException::do_throw(); // Forward that ForcefulKill exception
throw;
}
});
py::gil_scoped_acquire py_context;
fun(*args);
} catch (const py::error_already_set& ex) {
- if (ex.matches(pyForcefulKillEx)) {
- XBT_VERB("Actor killed");
- simgrid::ForcefulKillException::do_throw(); // Forward that ForcefulKill exception
- }
+ XBT_VERB("Actor killed");
+ simgrid::ForcefulKillException::do_throw(); // Forward that ForcefulKill exception
throw;
}
});