|
DynExp
Highly flexible laboratory automation for dynamically changing experiments.
|
DynExp exceptions are derived from this class. It contains basic information about the cause of the exception as well as a stacktrace. More...
#include <Exception.h>
Inheritance diagram for Util::Exception:Public Member Functions | |
| Exception (std::string Description, const ErrorType Type=ErrorType::Error, const int ErrorCode=-1, const std::source_location Location=std::source_location::current()) noexcept | |
| Constructs an exception. Constructor is noexcept, although std::runtime_error() might throw std::bad_alloc issuing a call to std::terminate(), which might be the best solution in that case. | |
| virtual | ~Exception ()=default |
| constexpr const char * | GetErrorLabel () const |
| constexpr const char * | GetErrorLabelColor () const |
Static Public Member Functions | |
| static constexpr const char * | GetErrorLabel (const ErrorType Type) |
| Converts an error type to a user-readable label for logging. | |
| static constexpr const char * | GetErrorLabelColor (const ErrorType Type) |
| Converts an error type to an HTML color name for logging. | |
Public Attributes | |
| const ErrorType | Type |
| DynExp error type from Util::ErrorType | |
| const int | ErrorCode |
| DynExp error code from DynExpErrorCodes::DynExpErrorCodes | |
| const size_t | Line |
| Line in source code where the exception occurred. | |
| const std::string | Function |
| Function in source code where the exception occurred | |
| const std::string | File |
| Source code file where the exception occurred. | |
DynExp exceptions are derived from this class. It contains basic information about the cause of the exception as well as a stacktrace.
Definition at line 50 of file Exception.h.
|
noexcept |
Constructs an exception. Constructor is noexcept, although std::runtime_error() might throw std::bad_alloc issuing a call to std::terminate(), which might be the best solution in that case.
| Description | Description explaining the cause of the exception in detail for the user. |
| Type | Error type from Util::ErrorType |
| ErrorCode | Error code from DynExpErrorCodes |
| Location | Used to derive the origin of the exception. Pass the result of std::source_location::current() as called by the constructor of the derived classes. |
Definition at line 8 of file Exception.cpp.
|
virtualdefault |
|
inlineconstexpr |
Definition at line 98 of file Exception.h.
|
inlinestaticconstexpr |
Converts an error type to a user-readable label for logging.
| Type | Error type from Util::ErrorType |
Definition at line 71 of file Exception.h.
|
inlineconstexpr |
Definition at line 99 of file Exception.h.
|
inlinestaticconstexpr |
Converts an error type to an HTML color name for logging.
| Type | Error type from Util::ErrorType |
Definition at line 87 of file Exception.h.
| const int Util::Exception::ErrorCode |
DynExp error code from DynExpErrorCodes::DynExpErrorCodes
Definition at line 106 of file Exception.h.
| const std::string Util::Exception::File |
Source code file where the exception occurred.
Definition at line 109 of file Exception.h.
| const std::string Util::Exception::Function |
Function in source code where the exception occurred
Definition at line 108 of file Exception.h.
| const size_t Util::Exception::Line |
Line in source code where the exception occurred.
Definition at line 107 of file Exception.h.
| const ErrorType Util::Exception::Type |
DynExp error type from Util::ErrorType
Definition at line 105 of file Exception.h.