A convenient exception handling class. More...

#include <Error.h>

Public Member Functions

 Error (ErrorCode c, std::string func, const char *msg=0,...)
 Error with optional printf-style message.
 Error (ErrorCode c, std::string func, std::string msg)
 Error with string message.
virtual ~Error ()
 Virtual destructor enables inheritance.
const Erroroperator+= (const char *func)
 Add function name to the list.
const Erroroperator+= (const std::string &func)
 Add function name to the list.
virtual void report (std::ostream &ostr) const
 Write error and auxilliary info to ostream.
virtual std::string warning () const
 Write function name and error message to screen.
const std::string get_message () const
 Get the error message.
ErrorCode get_code () const
 Get the error code.

Static Public Member Functions

static const char * err2str (ErrorCode code)
 convert an error code to a character string

Static Public Attributes

static bool verbose = false
 During constructor, print messages.
static bool complete_abort = false
 After construction raise a sigkill.

Protected Member Functions

 Error ()
 Null constructor is protected.
void errno_check ()
 If errno is set, adds a string to message.
void construct (ErrorCode c, const std::string &func, const char *msg)
 Contruct the basic deal.

Protected Attributes

ErrorCode code
 the error code
std::string message
 auxilliary message
std::vector< std::string > functions
 function name stack

Friends

template<class T>
Erroroperator<< (Error &error, const T &t)
 Add to the Error message.

Detailed Description

A convenient exception handling class.


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

Generated using doxygen 1.14.0