X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/e2ff9669502bd6fc2ad1614103bea9e1edf36980..3bf15ad45770ae3b776962f3f3fb268de4534769:/include/simgrid/Exception.hpp diff --git a/include/simgrid/Exception.hpp b/include/simgrid/Exception.hpp index 304295ae96..d56a371a9c 100644 --- a/include/simgrid/Exception.hpp +++ b/include/simgrid/Exception.hpp @@ -153,6 +153,16 @@ DECLARE_SIMGRID_EXCEPTION(TracingError); DECLARE_SIMGRID_EXCEPTION(ParseError, PARSE_ERROR_CONSTRUCTOR); #undef PARSE_ERROR_CONSTRUCTOR +/** Exception raised by s4u_enforce, when an assertion is not satisfied */ +#define ASSERTION_ERROR_CONSTRUCTOR \ + template AssertionError(const char * f, Args... args) \ + : Exception(XBT_THROW_POINT, xbt::string_printf(f, args...)) \ + { \ + } + +DECLARE_SIMGRID_EXCEPTION(AssertionError, ASSERTION_ERROR_CONSTRUCTOR); +#undef ASSERTION_ERROR_CONSTRUCTOR + #undef DECLARE_SIMGRID_EXCEPTION class XBT_PUBLIC ForcefulKillException {