Class Error

class Error

A convenient exception handling class.

Public 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.

Error(std::exception&, std::string func, std::string msg = std::string())

Used to rethrow std::exception.

virtual ~Error()

Virtual destructor enables inheritance.

const Error &operator+=(const char *func)

Add function name to the list.

const Error &operator+=(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.

inline ErrorCode get_code() const

Get the error code.

Public Static Functions

static const char *err2str(ErrorCode code)

convert an error code to a character string

Public Static Attributes

static bool verbose

During constructor, print messages.

static bool complete_abort

After construction raise a sigkill.

Friends

template<class T>
friend Error &operator<<(Error &error, const T &t)

Add to the Error message.