-/** Exception raised when a timeout elapsed */
-class TimeoutException : public Exception {
-public:
- using Exception::Exception;
- ~TimeoutException() override;
-};
+#define DECLARE_SIMGRID_EXCEPTION(AnyException, ...) \
+ class AnyException : public Exception { \
+ public: \
+ using Exception::Exception; \
+ __VA_ARGS__ \
+ ~AnyException() override; \
+ XBT_ATTRIB_NORETURN void rethrow_nested(simgrid::xbt::ThrowPoint&& throwpoint, \
+ const std::string& message) const override \
+ { \
+ std::throw_with_nested(AnyException(std::move(throwpoint), message)); \
+ } \
+ }