Extended exception class that bundles location, message and data. More...
#include <data_exception.hpp>
Public Member Functions | |
DataException (const char *loc, const DataException< Data > &e) | |
DataException (const char *loc, ErrorFlag error, const std::string &msg, const Data &d) | |
DataException (const char *loc, ErrorFlag error, Data &d) | |
const char * | what () const throw () |
virtual | ~DataException () throw () |
Private Attributes | |
Data | error_data |
ErrorFlag | error_type |
std::string | message |
Additional Inherited Members | |
Protected Member Functions inherited from ecl::Exception | |
Exception () | |
Exception (const char *loc) | |
Protected Attributes inherited from ecl::Exception | |
std::string | location |
Extended exception class that bundles location, message and data.
This exception class extends the StandardException to include an additional component, a single data object. Usually its a good idea to keep the data object small - it is copied into the exception so that it cannot be lost if the original object should die.
The bundled data object must be streamable to standard output if this class is going to utilise the generic what() output.
Definition at line 66 of file data_exception.hpp.
ecl::DataException< Data >::DataException | ( | const char * | loc, |
ErrorFlag | error, | ||
Data & | d | ||
) |
Default constructor for data exceptions.
loc | : use with the LOC macro, identifies the line and file of the code. |
error | : enumerated exception error type. |
d | : the data bundled with the exception. |
Definition at line 96 of file data_exception.hpp.
ecl::DataException< Data >::DataException | ( | const char * | loc, |
ErrorFlag | error, | ||
const std::string & | msg, | ||
const Data & | d | ||
) |
Constructor for data exceptions with a custom message.
loc | : use with the LOC macro, identifies the line and file of the code. |
error | : enumerated exception error type. |
msg | : extra detail message. |
d | : the data bundled with the exception. |
Definition at line 109 of file data_exception.hpp.
ecl::DataException< Data >::DataException | ( | const char * | loc, |
const DataException< Data > & | e | ||
) |
Constructor for data exceptions that enables rethrowing of an existing exception up the heirarchy with a new code location stamp.
loc | : use with the LOC macro, identifies the line and file of the code. |
e | : a caught standard exception that is to be rethrown. |
Definition at line 122 of file data_exception.hpp.
|
inlinevirtual |
Definition at line 83 of file data_exception.hpp.
|
virtual |
Default exception handling output function.
Implements ecl::Exception.
Definition at line 136 of file data_exception.hpp.
|
private |
Definition at line 92 of file data_exception.hpp.
|
private |
Definition at line 91 of file data_exception.hpp.
|
private |
Definition at line 93 of file data_exception.hpp.