Davix Error Handler. More...
#include <davixstatusrequest.hpp>
Public Member Functions | |
DavixError (const std::string &scope, StatusCode::Code errCode, const std::string &errMsg) | |
DavixError (const DavixError &e) | |
DavixError & | operator= (const DavixError &e) |
DavixError * | clone () |
StatusCode::Code | getStatus () const |
void | setStatus (const StatusCode::Code) |
const std::string & | getErrMsg () const |
void | setErrMsg (const std::string &msg) |
void | setErrScope (const std::string &scope) |
const std::string & | getErrScope () const |
Static Public Member Functions | |
static void | setupError (DavixError **err, const std::string &scope, StatusCode::Code errCode, const std::string &errMsg) |
static void | clearError (DavixError **err) |
static void | propagateError (DavixError **newErr, DavixError *oldErr) |
static void | propagatePrefixedError (DavixError **newErr, DavixError *oldErr, const std::string &prefix) |
Davix Error Handler.
Error report system of Davix DavixError has a similar behavior to the glib Error system GError
Each function which takes a DavixError** as argument can take the value NULL
Example :
DavixError *tmp_err = NULL; do_operation(arg1,arg2, &tmp_err) if(tmp_err){ /* test if error occures
DavixError::DavixError | ( | const std::string & | scope, | |
StatusCode::Code | errCode, | |||
const std::string & | errMsg | |||
) |
Construct a DavixError object
scope | : string parameter representing the scope of the error | |
errCode | : Davix Error code, see Davix::StatusCode::Code | |
errMsg | : String representation of the error |
static void DavixError::clearError | ( | DavixError ** | err | ) | [static] |
clear the content of the current error and set err to NULL
DavixError* DavixError::clone | ( | ) |
clone this error in a new dynamically allocated one need to be delete
const std::string& DavixError::getErrMsg | ( | ) | const |
get the string representation of this error
const std::string& DavixError::getErrScope | ( | ) | const |
get the scope of this error
StatusCode::Code DavixError::getStatus | ( | ) | const |
static void DavixError::propagateError | ( | DavixError ** | newErr, | |
DavixError * | oldErr | |||
) | [static] |
propagate the Davix Error Object from oldErr to newErr OldErr can be consider as free after this operation erase the error message if newErr is NULL
static void DavixError::propagatePrefixedError | ( | DavixError ** | newErr, | |
DavixError * | oldErr, | |||
const std::string & | prefix | |||
) | [static] |
same than propagateError but add a string prefix in front of the error description
OldErr can be consider as free after this operation erase the error message if newErr is NULL
void DavixError::setErrMsg | ( | const std::string & | msg | ) |
set the string representation of this error
void DavixError::setErrScope | ( | const std::string & | scope | ) |
set the scope of this error
void DavixError::setStatus | ( | const StatusCode::Code | ) |
set the status code for this error
static void DavixError::setupError | ( | DavixError ** | err, | |
const std::string & | scope, | |||
StatusCode::Code | errCode, | |||
const std::string & | errMsg | |||
) | [static] |
create a new dynamically allocated DavixError Object if err is NULL, do nothing
scope | : string parameter representing the scope of the error | |
errCode | : Davix Error code, see Davix::StatusCode::Code | |
errMsg | : String representation of the error |