#include <error.hpp>


Common operations for getting an diagnostic message and for obtaining the root cause, i.e. the first exception encountered in a chain of exceptions.
Definition at line 49 of file error.hpp.
Public Member Functions | |
| Error (const Error &) throw () | |
| Error (std::exception const &cause, string description="", const char *const id=LUMIERA_ERROR_EXCEPTION) throw () | |
| Error (string description="", const char *const id=LUMIERA_ERROR_EXCEPTION) throw () | |
| const char * | getID () const throw () |
| the internal Lumiera-error-ID (was set as C-errorstate in ctor) | |
| const string & | getUsermsg () const throw () |
| extract the message to be displayed for the user | |
| Error & | prependInfo (const string &text) throw () |
| give additional developer info. | |
| const string & | rootCause () const throw () |
| 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 (const string &newMsg) throw () |
| replace the previous or default friendly message for the user. | |
| virtual const char * | what () const throw () |
| yield a diagnostic message characterising the problem | |
Static Private Member Functions | |
| static const string | extractCauseMsg (std::exception const &) throw () |
Private Attributes | |
| const string | cause_ |
| description of first exception encountered in the chain | |
| string | desc_ |
| detailed description of the error situation for the developers | |
| const char * | id_ |
| an LUMIERA_ERROR id, which is set as errorstate on construction | |
| string | msg_ |
| friendly message intended for users (to be localised) | |
| string | what_ |
| buffer for generating the detailed description on demand | |
| lumiera::Error::Error | ( | const Error & | ref | ) | throw () |
Definition at line 119 of file exception.cpp.
| const string lumiera::Error::extractCauseMsg | ( | std::exception const & | cause | ) | throw () [static, private] |
For internal use only.
get at the description message of the first exception encountered in a chain of exceptions
Definition at line 151 of file exception.cpp.
References cause_.
| const char* lumiera::Error::getID | ( | ) | const throw () [inline] |
| const string& lumiera::Error::getUsermsg | ( | ) | const throw () |
extract the message to be displayed for the user
| Error& lumiera::Error::prependInfo | ( | const string & | text | ) | throw () [inline] |
| const string& lumiera::Error::rootCause | ( | ) | const throw () [inline] |
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 74 of file error.hpp.
References cause_.
| Error& lumiera::Error::setUsermsg | ( | const string & | newMsg | ) | throw () [inline] |
| CStr lumiera::Error::what | ( | ) | const throw () [virtual] |
yield a diagnostic message characterising the problem
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 135 of file exception.cpp.
References cause_, desc_, id_, and what_.
Referenced by lumiera::AppState::abort(), asset::DB::clear(), control::HandlingPattern::invoke(), and lib::AllocationCluster::~AllocationCluster().

const string lumiera::Error::cause_ [private] |
description of first exception encountered in the chain
Definition at line 88 of file error.hpp.
Referenced by extractCauseMsg(), rootCause(), and what().
string lumiera::Error::desc_ [private] |
detailed description of the error situation for the developers
Definition at line 86 of file error.hpp.
Referenced by prependInfo(), and what().
const char* lumiera::Error::id_ [private] |
string lumiera::Error::msg_ [private] |
friendly message intended for users (to be localised)
Definition at line 85 of file error.hpp.
Referenced by setUsermsg().
string lumiera::Error::what_ [mutable, private] |
1.5.6