An exception can be constructed from atext, that is supposed to be a simple description of the error with out context (e.g. "Could not open file") error number and an error severity (recoverable or unrecoverable). From this basic information a inital error info object is created which is a publicly avaiable member of the exception class. To this error info contexts can be added ( a context has a text and a location, see class ErrorInfo
above).
Static methods. | |
The following static method can be called on the Exception class directly. | |
void | release (std::string &msg) |
Release contents of string container allocated by asString methods. | |
Public Member Functions | |
Exception (const ErrorMessage &rclMessage, TyErrorId ulErrorId, ErrorInfo::EnSeverity enSeverity) | |
Constructor. | |
Exception (const ErrorInfo &crclErrorInfo) | |
Constructor from an existing error info object. | |
virtual | ~Exception () UIMA_THROW0() |
Destructor. | |
virtual const char * | getName () const |
name of the exception (automatically set to the name of the class by our macros) | |
virtual const char * | what () const UIMA_THROW0() |
This is the ANSI standard exceptions way of returning the exception text. | |
virtual void | terminate () |
Called to terminate the program instead of actually throwing an exception if exception support is turned off. | |
virtual void | logExceptionData () |
Called to write out the exception error message before terminate the program if exception support is turned off. | |
std::string | asString () const |
formatted for error output of the exception to a string | |
ErrorInfo & | getErrorInfo () |
return a reference to the error info member object | |
const ErrorInfo & | getErrorInfo () const |
return a const reference to the error info member object | |
Static Public Member Functions | |
void | assertParameter (const char *cpszExceptionText, ErrorContext clContext) |
|
Constructor.
clMessage parameter should just state the plain info what went wrong (e.g. "Could not open file X"). Use an exception context to add information why, how it went wrong (e.g. "While trying to open application ini-file"). |
|
Constructor from an existing error info object.
|
|
Destructor.
|
|
name of the exception (automatically set to the name of the class by our macros)
|
|
This is the ANSI standard exceptions way of returning the exception text.
|
|
Called to terminate the program instead of actually throwing an exception if exception support is turned off.
|
|
Called to write out the exception error message before terminate the program if exception support is turned off.
|
|
|
|
formatted for error output of the exception to a string
|
|
return a reference to the error info member object
|
|
return a const reference to the error info member object
|
|
Release contents of string container allocated by asString methods.
|