Base exception. More...
#include <libppbase/base/Exception.h>
Public Member Functions | |
Exception (const char *fmt,...) | |
Constructor. | |
virtual | ~Exception () throw () |
Destructor. | |
void | appendMessage (const String &msg) |
Appends to the exception message. | |
int | getErrcode () const |
Gets the error code. | |
const String & | getLocation () const |
Gets the code location where the exception occurred. | |
const String & | getMessage () const |
Gets the application-defined message. | |
const String & | getNested () const |
Gets the nested exception. | |
const String & | getStacktrace () const |
Gets the whole stack trace. | |
const String & | getType () const |
Gets the exception type. | |
virtual String | toString () const |
Gets the string representation of this exception. | |
const char * | what () const throw () |
Gets the string representation of this exception. | |
Exception & | operator= (const Exception &ex) |
Assignment operator. | |
Static Public Member Functions | |
static void | trace (String &location, String &stacktrace) |
Gets the stack trace for the current thread or process. | |
Protected Member Functions | |
Exception (int errcode, const char *type) | |
Constructor for subclassing only. | |
Protected Attributes | |
int | _errcode |
application-defined error code | |
String | _location |
code location where the exception occurred, taken from the stack trace | |
String | _message |
error message | |
String | _nested |
nested exception | |
String | _stacktrace |
the entire stack trace | |
String | _type |
the exception type (name of subclass) |
Base exception.
base::Exception::Exception | ( | const char * | fmt, | |
... | ||||
) | [explicit] |
Constructor.
fmt | printf-like format string to take an additional error message | |
... | additional arguments for the format string |
base::Exception::Exception | ( | int | errcode, | |
const char * | type | |||
) | [protected] |
Constructor for subclassing only.
errcode | the error code | |
type | the exception type (=name of subclass) |
int base::Exception::getErrcode | ( | ) | const |
Gets the error code.
const String& base::Exception::getLocation | ( | ) | const |
Gets the code location where the exception occurred.
const String& base::Exception::getMessage | ( | ) | const |
Gets the application-defined message.
const String& base::Exception::getNested | ( | ) | const |
Gets the nested exception.
const String& base::Exception::getStacktrace | ( | ) | const |
Gets the whole stack trace.
const String& base::Exception::getType | ( | ) | const |
Gets the exception type.
Assignment operator.
This operator is required for MSVC 6, when assigning an exception to another one. Without this operator, the assignment operator of the superclass (std::exception) would be used, so that the members of this object are assigned strange values.
ex | the source exception |
virtual String base::Exception::toString | ( | ) | const [virtual] |
Gets the string representation of this exception.
Reimplemented in base::IOException, and base_crypto::CryptoException.
Gets the stack trace for the current thread or process.
location | returns the location of the current thread or process | |
stacktrace | returns the stack trace of the current thread or process |
const char* base::Exception::what | ( | ) | const throw () |
Gets the string representation of this exception.
Reimplementation of the what() method in std::exception