davix
Public Member Functions | Static Public Member Functions
Davix::DavixError Class Reference

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)
 copy constructor
 
DavixErroroperator= (const DavixError &e)
 assignment operator
 
virtual ~DavixError ()
 ~DavixError
 
DavixErrorclone ()
 clone Error
 
StatusCode::Code getStatus () const
 
void setStatus (const StatusCode::Code)
 set the status code for this error
 
const std::string & getErrMsg () const
 get the string representation of this error
 
void setErrMsg (const std::string &msg)
 set the string representation of this error
 
void setErrScope (const std::string &scope)
 set the scope of this error
 
const std::string & getErrScope () const
 get the scope of this error
 
void swap (DavixError &err)
 swap the two error content
 

Static Public Member Functions

static void setupError (DavixError **err, const std::string &scope, StatusCode::Code errCode, const std::string &errMsg)
 create a new DavixError
 
static void clearError (DavixError **err)
 clear the content of the current error and set err to NULL
 
static void propagateError (DavixError **newErr, DavixError *oldErr)
 propagate an Error structure to an upper level
 
static void propagatePrefixedError (DavixError **newErr, DavixError *oldErr, const std::string &prefix)
 propagatePrefixedError
 

Detailed Description

Davix Error Handler.

Error report system of Davix, similar behavior to the Glib Error report Davix does not use C++ exception

Each function which takes a DavixError** as argument can take the value NULL

Example :

Constructor & Destructor Documentation

◆ DavixError() [1/2]

Davix::DavixError::DavixError ( const std::string &  scope,
StatusCode::Code  errCode,
const std::string &  errMsg 
)

Construct a DavixError object

Parameters
scope: string parameter representing the scope of the error
errCode: Davix Error code, see Davix::StatusCode::Code
errMsg: String representation of the error

◆ DavixError() [2/2]

Davix::DavixError::DavixError ( const DavixError e)

copy constructor

Parameters
e

Member Function Documentation

◆ clone()

DavixError * Davix::DavixError::clone ( )

clone Error

Returns
new dynamically allocated copy of the Error

◆ getStatus()

StatusCode::Code Davix::DavixError::getStatus ( ) const
Returns
Davix status code of the error

◆ operator=()

DavixError & Davix::DavixError::operator= ( const DavixError e)

assignment operator

Parameters
e
Returns

◆ propagateError()

static void Davix::DavixError::propagateError ( DavixError **  newErr,
DavixError oldErr 
)
static

propagate an Error structure to an upper level

Parameters
newErr
oldErr

propagate the Davix Error Object from oldErr to newErr OldErr can be consider as free after this operation erase the current error if newErr is not NULL

◆ propagatePrefixedError()

static void Davix::DavixError::propagatePrefixedError ( DavixError **  newErr,
DavixError oldErr,
const std::string &  prefix 
)
static

propagatePrefixedError

Parameters
newErr
oldErr
prefix

same than propagateError but add a string prefix in front of the error description

◆ setupError()

static void Davix::DavixError::setupError ( DavixError **  err,
const std::string &  scope,
StatusCode::Code  errCode,
const std::string &  errMsg 
)
static

create a new DavixError

Parameters
errpointer to a DavixError pointer
scopescope of the Error
errCodeError code
errMsgError message

create a new dynamically allocated DavixError Object if err is NULL, silent suppress the error report

◆ swap()

void Davix::DavixError::swap ( DavixError err)

swap the two error content

Parameters
err

The documentation for this class was generated from the following file: