![]() |
Lumiera 0.pre.04~rc.1
»edit your freedom«
|
#include "lib/error.hpp"
Interface and Base definition for all Lumiera Exceptions.
Provides common operations for getting a diagnostic message and to obtain the root cause message, i.e. the message from the first exception encountered in a chain of exceptions.
Public Member Functions | |
| virtual | ~Error () noexcept |
| Error (string description="", lumiera_err const id=LERR_(EXCEPTION)) noexcept | |
| this is an interface | |
| Error (std::exception const &cause, string description="", lumiera_err const id=LERR_(EXCEPTION)) noexcept | |
| Error (Error &&)=default | |
| Error (Error const &)=default | |
| Error & | operator= (Error &&)=delete |
| Error & | operator= (Error const &)=delete |
| virtual CStr | what () const noexcept override |
| std::exception interface : yield a diagnostic message | |
| lumiera_err | getID () const noexcept |
| the internal Lumiera-error-ID (was set as C-errorstate in ctor) | |
| string const & | getUsermsg () const noexcept |
| extract the message to be displayed for the user | |
| string const & | rootCause () const noexcept |
| If this exception was caused by a chain of further exceptions, return the description of the first one registered in this throw sequence. | |
| Error & | setUsermsg (string const &newMsg) noexcept |
| replace the previous or default friendly message for the user. | |
| Error & | prependInfo (string const &text) noexcept |
| give additional developer info. | |
Static Private Member Functions | |
| static const string | extractCauseMsg (std::exception const &) noexcept |
Private Attributes | |
| lumiera_err const | id_ |
| an LUMIERA_ERROR id, which is set as errorstate on construction | |
| string | msg_ |
| friendly message intended for users (to be localised) | |
| string | desc_ |
| detailed description of the error situation for the developers | |
| string | what_ |
| buffer for generating the detailed description on demand | |
| const string | cause_ |
| description of first exception encountered in the chain | |
|
noexcept |
this is an interface
Definition at line 90 of file error-exception.cpp.
|
noexcept |
Definition at line 99 of file error-exception.cpp.
|
overridevirtualnoexcept |
std::exception interface : yield a diagnostic message
Description of the problem, including the internal char constant in accordance to Lumiera's error identification scheme.
If a root cause can be obtained, this will be included in the generated output as well.
Definition at line 119 of file error-exception.cpp.
References Error::cause_, Error::desc_, Error::id_, and Error::what_.
Referenced by AppState::abort(), OutputDirector::bringDown(), ExceptionError_test::catcher(), ExceptionError_test::doubleNestedTh(), Error::extractCauseMsg(), test::anonymous_namespace{suite.cpp}::invokeTestCase(), lumiera::error::lumiera_unexpectedException(), GtkLumiera::run(), ZombieCheck_test::run(), and MockSys::run().
Here is the caller graph for this function:
|
inlinenoexcept |
the internal Lumiera-error-ID (was set as C-errorstate in ctor)
Definition at line 95 of file error.hpp.
References Error::id_.
Referenced by lumiera::error::lumiera_unexpectedException().
Here is the caller graph for this function:
|
inlinenoexcept |
extract the message to be displayed for the user
Definition at line 102 of file error.hpp.
References Error::msg_.
Referenced by lumiera::error::lumiera_unexpectedException().
Here is the caller graph for this function:
|
inlinenoexcept |
If this exception was caused by a chain of further exceptions, return the description of the first one registered in this throw sequence.
This works only if every exceptions thrown as a consequence of another exception is properly constructed by passing the original exception to the constructor
Definition at line 114 of file error.hpp.
References Error::cause_.
Referenced by ExceptionError_test::checkRootCauseChaining(), and lumiera::error::lumiera_unexpectedException().
Here is the caller graph for this function:
|
inlinenoexcept |
replace the previous or default friendly message for the user.
Definition at line 123 of file error.hpp.
References Error::msg_.
|
inlinenoexcept |
give additional developer info.
Typically used at intermediate handlers to add context.
Definition at line 131 of file error.hpp.
References Error::desc_.
|
staticprivatenoexcept |
get at the description message of the first exception encountered in a chain of exceptions
Definition at line 135 of file error-exception.cpp.
References Error::what().
Here is the call graph for this function:
|
private |
an LUMIERA_ERROR id, which is set as errorstate on construction
Definition at line 66 of file error.hpp.
Referenced by Error::getID(), and Error::what().
|
private |
friendly message intended for users (to be localised)
Definition at line 67 of file error.hpp.
Referenced by Error::getUsermsg(), and Error::setUsermsg().
|
private |
detailed description of the error situation for the developers
Definition at line 68 of file error.hpp.
Referenced by Error::prependInfo(), and Error::what().
|
mutableprivate |
buffer for generating the detailed description on demand
Definition at line 69 of file error.hpp.
Referenced by Error::what().
|
private |
description of first exception encountered in the chain
Definition at line 70 of file error.hpp.
Referenced by Error::rootCause(), and Error::what().
Inheritance diagram for Error:
Collaboration diagram for Error: