DAVID4 SDK
1.8.7
|
Easy conversion from error codes to exceptions. More...
#include <Exceptions.h>
Public Member Functions | |
ErrorExceptionConverter (const std::string &source="") | |
Constructor. More... | |
virtual | ~ErrorExceptionConverter () |
Destructor. | |
int | operator= (int errorCode) |
Throws an exception, if 'errorCode' is less then zero. More... | |
ErrorExceptionConverter & | operator() (const std::string &context) |
Set more context information to source. More... | |
std::string | GetSource () const |
Get source information. More... | |
std::string | GetContext () const |
Get context information. More... | |
Easy conversion from error codes to exceptions.
The error code has to be one of david::ErrorCode.
Example:
Definition at line 133 of file Exceptions.h.
|
inline |
Constructor.
[in] | source | Optional source information. |
Definition at line 138 of file Exceptions.h.
|
inline |
|
inline |
ErrorExceptionConverter& david::ErrorExceptionConverter::operator() | ( | const std::string & | context) |
Set more context information to source.
The context information will be available in source info of an exception. The automatic Id will be reset to zero.
[in] | context | More context information. |
int david::ErrorExceptionConverter::operator= | ( | int | errorCode) |
Throws an exception, if 'errorCode' is less then zero.
An assignment will also increment the automatic Id. The automatic Id will will be available in source info of an exception.
[in] | errorCode | See david::ErrorCode. |