30#define THROW_IF_NOT_UNWINDING(exclass, msg_construct) \
31 if(std::uncaught_exceptions() > 0){ \
32 std::cerr << msg_construct << std::endl; \
34 throw exclass() << msg_construct; \
37#define DO_PRAGMA(x) _Pragma(#x)
38#define TERMINATING_THROW(exclass, msg_construct) \
39 DO_PRAGMA(GCC diagnostic push) \
40 DO_PRAGMA(GCC diagnostic ignored "-Wterminate") \
41 throw exclass() << msg_construct; \
42 DO_PRAGMA(GCC diagnostic pop)
97 const
char*
what() const noexcept {
98 reason_str_ = reason_.str();
99 return reason_str_.c_str();
141 std::string raw_reason_;
144 std::stringstream reason_;
147 std::unique_ptr<app::BacktraceData> bt_;
151 mutable std::string reason_str_;
Indicates something went seriously wrong and likely indicates corruption in simulator runtime state.
SpartaCriticalError(const std::string &reason)
Construct a SpartaCriticalException object.
SpartaCriticalError()
Construct a SpartaCriticalException object.
Used to construct and throw a standard C++ exception. Inherits from std::exception.
const char * what() const noexcept
Overload from std::exception.
virtual ~SpartaException() noexcept
Destroy!
SpartaException(const std::string &reason)
Construct a SpartaException object.
SpartaException()
Construct a SpartaException object with empty reason.
SpartaException(const SpartaException &orig)
Copy construct a SpartaException object.
SpartaException & operator<<(const T &msg)
Append additional information to the message.
std::string rawReason() const
Return the raw reason without file, line information.
std::string backtrace() const noexcept
Returns the backtrace at the time this exception was generated.
Indicates something went seriously wrong and likely indicates unrecoverable corruption in simulator r...
SpartaFatalError(const std::string &reason)
Construct a SpartaFatalError object.
SpartaFatalError()
Construct a SpartaFatalError object.
Macros for handling exponential backoff.