wibble
1.1
|
Base class for system exceptions. More...
#include <exception.h>
Public Member Functions | |
System (const std::string &context) throw () | |
System (int code, const std::string &context) throw () | |
virtual const char * | type () const throw () |
Get a string tag identifying the exception type. More... | |
virtual int | code () const throw () |
Get the system error code associated to the exception. More... | |
virtual std::string | desc () const throw () |
Get the description of the error code. More... | |
![]() | |
Generic () throw () | |
Generic (const std::string &context) throw () | |
virtual | ~Generic () throw () |
virtual const std::string & | fullInfo () const throw () |
Format in a string all available information about the exception. More... | |
virtual const char * | what () const throw () |
![]() | |
Context () throw () | |
Context (const std::string &context) throw () | |
void | addContext (const std::string &c) throw () |
std::string | formatContext () const throw () |
const std::vector< std::string > & | context () const throw () |
Protected Attributes | |
int | m_errno |
![]() | |
std::string | m_formatted |
![]() | |
std::vector< std::string > | m_context |
Base class for system exceptions.
This is the base class for exceptions that depend on system events, like exceptions on file or network I/O, on database access and so on. SystemExceptions introduces the keeping of an error code with an associated string description, and by defaults provides the textual description for Unix errno error codes. The exception context should be phrased like "doing X".
Example:
wibble::exception::System::System | ( | const std::string & | context) | ||
throw | ( | ||||
) |
wibble::exception::System::System | ( | int | code, |
const std::string & | context | ||
) | |||
throw | ( | ||
) |
|
inlinevirtual |
Get the system error code associated to the exception.
Referenced by TestException::system().
|
virtual |
Get the description of the error code.
Reimplemented from wibble::exception::Generic.
Reimplemented in wibble::exception::File.
Referenced by wibble::exception::File::desc().
|
inlinevirtual |
Get a string tag identifying the exception type.
Reimplemented from wibble::exception::Generic.
Reimplemented in wibble::exception::File.
|
protected |