Manticore
Version 1.5.3
Physics of Molecular Clouds
|
MathUtils exception (base) class. More...
#include <mutils/Exception.h>
Public Member Functions | |
Exception (int level=Log::ERROR) | |
Default constructor. More... | |
virtual | ~Exception () noexcept |
Destructor. More... | |
void | message (const char *msg) |
Assigns error message. More... | |
void | print () const |
Prints error message to log. More... | |
virtual const char * | what () const noexcept |
Returns error string. More... | |
![]() | |
T | exception (T... args) |
T | ~exception (T... args) |
T | operator= (T... args) |
T | what (T... args) |
Public Attributes | |
int | level |
Condition log level. More... | |
Static Public Attributes | |
static bool | errors = false |
Whether to print error messages (else throw exceptions). More... | |
Protected Attributes | |
std::string | msg_ |
Error message. More... | |
MathUtils exception (base) class.
This class serves as the base for all MathUtils exceptions. In practice, MathUtils code uses this class to propagate error messages for fatal errors. Non-fatal errors should use either a derived sub-class or one of the existing C++ exception types, not this class; alternatively, MU_ERROR_RTN() can be used instead of an exception if a chain of return status values is present.
Author: Kevin P. Rauch <rauch> @ast ro.um d.ed u
Definition at line 146 of file Exception.h.
|
inline |
Default constructor.
[in] | level | Log level. |
Definition at line 151 of file Exception.h.
References message().
|
inlinevirtualnoexcept |
Destructor.
Definition at line 155 of file Exception.h.
|
inline |
Assigns error message.
[in] | msg | Error message. |
Definition at line 159 of file Exception.h.
References level, msg_, and mutils::Log::name().
Referenced by Exception().
|
inline |
Prints error message to log.
Definition at line 166 of file Exception.h.
References level, mutils::Log::level, mutils::Log::stream, and what().
|
inlinevirtualnoexcept |
Returns error string.
Definition at line 172 of file Exception.h.
References std::string::c_str(), and msg_.
Referenced by print().
|
static |
Whether to print error messages (else throw exceptions).
Enabling this results in error messages instead of exceptions being thrown, allowing execution to continue (to the point of catastrophic failure). For diagnostic use only.
Definition at line 182 of file Exception.h.
int mutils::Exception::level |
Condition log level.
Definition at line 175 of file Exception.h.
|
protected |