lumiera::Error Class Reference

#include <error.hpp>

Inheritance diagram for lumiera::Error:

Inheritance graph
[legend]
Collaboration diagram for lumiera::Error:

Collaboration graph
[legend]

List of all members.


Detailed Description

Interface and Base class of all Exceptions thrown from within Lumiera (C++) code.

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
ErrorprependInfo (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.
ErrorsetUsermsg (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

Constructor & Destructor Documentation

lumiera::Error::Error ( const Error ref  )  throw ()

Note:
copy ctor behaves like chaining, i.e setting the cause_.

Definition at line 119 of file exception.cpp.


Member Function Documentation

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]

the internal Lumiera-error-ID (was set as C-errorstate in ctor)

Definition at line 63 of file error.hpp.

References id_.

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]

give additional developer info.

Typically used at intermediate handlers to add context.

Definition at line 80 of file error.hpp.

References desc_.

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

Returns:
the description string, maybe empty (if there is no known root cause)

Definition at line 74 of file error.hpp.

References cause_.

Error& lumiera::Error::setUsermsg ( const string &  newMsg  )  throw () [inline]

replace the previous or default friendly message for the user.

To be localised.

Definition at line 77 of file error.hpp.

References msg_.

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().

Here is the caller graph for this function:


Member Data Documentation

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]

an LUMIERA_ERROR id, which is set as errorstate on construction

Definition at line 84 of file error.hpp.

Referenced by getID(), and what().

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]

buffer for generating the detailed description on demand

Definition at line 87 of file error.hpp.

Referenced by what().


The documentation for this class was generated from the following files:

Generated on Sun Aug 1 21:33:08 2010 for Lumiera by  doxygen 1.5.6