|
MGIS 3.1.0
|
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 |
| a simple alias listing the main way to report an error. | |
Public Member Functions | |
| void | assertOrTerminate (const bool, const char *const) |
| assert that the given boolean is true. If false, terminate is called. | |
| void | assertOrTerminate (const bool, const ErrorReport) |
| assert that the given boolean is true. If false, terminate is called. | |
| void | terminate (const char *const) |
| terminate the excution after displaying the given error message | |
| void | terminate (const ErrorReport) |
| terminate the excution after displaying the given error message | |
| InvalidResult | registerErrorMessage (const char *const) final |
| register a new error message | |
| InvalidResult | registerErrorMessage (const ErrorReport) MGIS_NOEXCEPT |
| register a new error message | |
| template<typename ReturnType> requires (internal::InvalidValueTraits<ReturnType>::isSpecialized) | |
| ReturnType | registerErrorMessage (const char *const) |
| register a new error message | |
| template<typename ReturnType> requires (internal::InvalidValueTraits<ReturnType>::isSpecialized) | |
| ReturnType | registerErrorMessage (const ErrorReport) MGIS_NOEXCEPT |
| register a new error message | |
| InvalidResult | registerErrorMessageWithoutSourceLocation (const ErrorReport) MGIS_NOEXCEPT |
| register a new error message | |
| void | clearErrorMessages () MGIS_NOEXCEPT |
| remove the error messages | |
| std::string | getErrorMessage (const bool=true) MGIS_NOEXCEPT |
| std::string | getRawErrorMessage (const bool=true) MGIS_NOEXCEPT |
| bool | empty () const MGIS_NOEXCEPT |
| ~ErrorBacktrace () noexcept override | |
| destructor | |
| Public Member Functions inherited from mgis::AbstractErrorHandler | |
| virtual constexpr | ~AbstractErrorHandler ()=default |
| destructor | |
Static Public Member Functions | |
| static void | setErrorReportingAsFatal () MGIS_NOEXCEPT |
| specify if error reporting shall be fatal | |
| static void | unsetErrorReportingAsFatal () MGIS_NOEXCEPT |
| specify if error reporting shall be fatal | |
| static void | abort (std::string_view) |
| call the terminate handler | |
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...)
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.
|
static |
call the terminate handler
| [in] | msg | message |
|
inline |
assert that the given boolean is true. If false, terminate is called.
| [in] | b | test |
| [in] | e | error message |
|
inline |
assert that the given boolean is true. If false, terminate is called.
| [in] | b | test |
| [in] | e | error code |
|
nodiscard |
|
nodiscard |
| [in] | b | boolean. If true, the error message are cleared |
|
nodiscard |
| [in] | b | boolean. If true, the error message are cleared |
|
nodiscardvirtual |
register a new error message
| [in] | e | error message |
Implements mgis::AbstractErrorHandler.
|
nodiscardfinalvirtual |
register a new error message
| [in] | e | error message |
Implements mgis::AbstractErrorHandler.
|
nodiscard |
register a new error message
| [in] | e | error code |
|
nodiscard |
register a new error message
| [in] | e | error code |
|
nodiscard |
register a new error message
| [in] | e | error code |
| void mgis::ErrorBacktrace::terminate | ( | const char * const | ) |
terminate the excution after displaying the given error message
| [in] | e | error message |
| void mgis::ErrorBacktrace::terminate | ( | const ErrorReport | ) |
terminate the excution after displaying the given error message
| [in] | e | error code |