10class Exception :
public std::exception {
12 template <
typename... Args>
13 Exception(
FormatCheck<std::type_identity_t<Args>...> s,Args&&... args) { message_ = std::vformat(s.get(),std::make_format_args(args...)); }
14 Exception(
const string &s) : message_(s) { }
15 Exception(
string &&s) : message_(std::move(s)) {}
16 Exception(
const Exception &e) : message_(e.message_) { }
17 Exception(Exception &&e) : message_(std::move(e.message_)) { }
18 Exception &operator=(
const Exception &e) { message_ = e.message_;
return *
this; }
19 Exception &operator=(Exception &&e) { message_ = std::move(e.message_);
return *
this; }
22 BASE_EXPORT const char *
what()
const throw()
override {
return message_.c_str(); }
32class QuitException :
public Exception {
44 : Exception(
"Processing interrupted by user."), safe_(safe), state_(
state) { }
includes std::string and additional functions not included in the standard.
BASE_EXPORT const char * what() const override
Returns the contents of the error message as a const char.
Definition baseexception.h:22
void setMessage(const string &s)
Allows the message carried by the exception to be replaced with a new one.
Definition baseexception.h:25
BASE_EXPORT string state() const
Definition baseexception.h:52
BASE_EXPORT bool wasSafe() const
returns TRUE if the interrupt was "Safe", in that the model was left in a repeatable and valid state.
Definition baseexception.h:47
BASE_EXPORT InterruptException(bool safe, const string &state=string())
Definition baseexception.h:43
#define BASE_EXPORT
Definition basedef.h:25