|
MGIS
|
a structure to keep trace of error messages. More...
#include </home/runner/work/MFrontGenericInterfaceSupport/MFrontGenericInterfaceSupport/include/MGIS/ErrorBacktrace.hxx>
Public Types | |
| using | ErrorReportFunction = std::string(*)(const int) |
| brief a simple alias | |
| using | ErrorReport = std::variant< const char *, std::pair< int, ErrorReportFunction >, std::string > |
| a simple alias listing the main way to report an error. | |
Public Member Functions | |
| InvalidResult | registerErrorMessage (const char *const) override final |
| register a new error message | |
| InvalidResult | registerErrorMessage (const ErrorReport) noexcept |
| register a new error message | |
| InvalidResult | registerErrorMessageWithoutSourceLocation (const ErrorReport) noexcept |
| register a new error message | |
| void | clearErrorMessages () noexcept |
| remove the error messages | |
| std::string | getErrorMessage (const bool=true) noexcept |
| std::string | getRawErrorMessage (const bool=true) noexcept |
| bool | empty () const noexcept |
| ~ErrorBacktrace () noexcept override | |
| destructor | |
Public Member Functions inherited from mgis::AbstractErrorHandler | |
| virtual constexpr | ~AbstractErrorHandler ()=default |
| destructor | |
a structure to keep trace of error messages.
The design of this class is inspired by the many solutions offered by the standard library (exceptions, std::error_code, etc...)
| using mgis::ErrorBacktrace::ErrorReport = std:: variant<const char *, std::pair<int, ErrorReportFunction>, std::string> |
a simple alias listing the main way to report an error.
The alternatives way of reporting an error are:
Building complex error message shall be avoided as much as possible in template code.
|
noexcept |
|
noexcept |
| [in] | b | boolean. If true, the error message are cleared |
|
noexcept |
| [in] | b | boolean. If true, the error message are cleared |
|
finaloverridevirtual |
register a new error message
| [in] | e | error message |
Implements mgis::AbstractErrorHandler.
|
noexcept |
register a new error message
| [in] | e | error code |
|
noexcept |
register a new error message
| [in] | e | error code |
InvalidResult