MIRA
|
Base class for exceptions. More...
#include <error/Exception.h>
Classes | |
struct | Info |
The info packet that is added in MIRA_THROW and MIRA_RETHROW. More... | |
Public Member Functions | |
Exception (std::string message, const char *file=NULL, int line=0) MIRA_NOEXCEPT_OR_NOTHROW | |
The constructor. More... | |
virtual | ~Exception () MIRA_NOEXCEPT_OR_NOTHROW |
Destructor. More... | |
void | addInfo (std::string message, const char *file=NULL, int line=0) |
Adds additional information to the exception. More... | |
virtual const char * | what () const MIRA_NOEXCEPT_OR_NOTHROW |
Returns the text of exception containing the information given in MIRA_THROW and MIRA_RETHROW as well as the file name and line number where it was thrown. More... | |
std::string | message () const MIRA_NOEXCEPT_OR_NOTHROW |
Similar to what(). More... | |
const CallStack & | callStack () const |
Returns the state of the callstack at the moment when the exception was thrown. More... | |
ThreadID | getThreadID () const |
Returns the id of the thread where the exception was thrown. More... | |
template<typename DerivedException > | |
DerivedException & | addStackInfo () |
FOR INTERNAL USE ONLY. More... | |
template<typename DerivedException > | |
DerivedException & | addExternalStackInfo (CallStack stack, ThreadID thread) |
Stores the provided callstack and thread id within the exception. More... | |
const Info & | getInfo () const |
Returns the first info packet that describes the location where the exception has occured. More... | |
Protected Member Functions | |
Exception () MIRA_NOEXCEPT_OR_NOTHROW | |
Protected Attributes | |
std::list< Info > | mInfos |
CallStack | mStack |
ThreadID | mThreadID |
std::string | mMessage |
as cache for what() More... | |
Base class for exceptions.
The what()-text contains file name and line number where the exception was thrown as well as additional information that was specified in MIRA_THROW and MIRA_RETHROW.
This exception class also keeps track of the call stack, which can be used to improve tracing of errors and exceptions.
For detailed information see Error and Exception Handling.
|
inlineprotected |
|
inline |
The constructor.
|
inlinevirtual |
Destructor.
|
inline |
Adds additional information to the exception.
|
virtual |
Returns the text of exception containing the information given in MIRA_THROW and MIRA_RETHROW as well as the file name and line number where it was thrown.
std::string message | ( | ) | const |
Similar to what().
Returns the text of exception containing the information given in MIRA_THROW and MIRA_RETHROW without the file name and line number in a single line string.
|
inline |
Returns the state of the callstack at the moment when the exception was thrown.
|
inline |
Returns the id of the thread where the exception was thrown.
|
inline |
FOR INTERNAL USE ONLY.
Stores the current callstack and thread id within the exception. This method is called by the MIRA_THROW macro and is for internal use. You never need to call this method manually.
Stores the provided callstack and thread id within the exception.
This can be used to create an exception with a callstack from an external source (e.g. for an exception originally thrown in an RPC).
|
inline |
Returns the first info packet that describes the location where the exception has occured.
|
protected |
|
protected |
|
protected |
|
mutableprotected |
as cache for what()