wibble::exception::Generic Class Reference

Base class for all exceptions. More...

`#include <exception.h>`

Inheritance diagram for wibble::exception::Generic:
[legend]
Collaboration diagram for wibble::exception::Generic:
[legend]

## Public Member Functions

| Generic () throw ()
| Generic (const std::string &context) throw ()
virtual | ~Generic () throw ()
virtual const char * | type () const throw ()
| Get a string tag identifying the exception type. More...
virtual std::string | desc () const throw ()
| Get a string describing what happened that threw the exception. More...
virtual const std::string & | fullInfo () const throw ()
| Format in a string all available information about the exception. More...
virtual const char * | what () const throw ()
Public Member Functions inherited from wibble::exception::Context
| 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

std::string | m_formatted
Protected Attributes inherited from wibble::exception::Context
std::vector< std::string > | m_context

## Detailed Description

Base class for all exceptions.

This is the base class for all exceptions used in the system. It provides an interface to get a (hopefully detailed) textual description of the exception, and a tag describing the type of exception. Further functionality will be provided by subclassers

## Constructor & Destructor Documentation

wibble::exception::Generic::Generic | ( |  | ) |
throw | ( |
| ) |  |

inline

wibble::exception::Generic::Generic | ( | const std::string & | context | ) |
throw | ( |
| ) |  |

inline

virtual wibble::exception::Generic::~Generic | ( |  | ) |
throw | ( |
| ) |  |

inline virtual

## Member Function Documentation

virtual std::string wibble::exception::Generic::desc | ( |  | ) | const
throw | ( |
| ) |  |

inline virtual

Get a string describing what happened that threw the exception.

Reimplemented in wibble::exception::File, wibble::exception::System, wibble::exception::ValOutOfRange< C >, wibble::exception::OutOfRange, wibble::exception::BadCast, wibble::exception::Consistency, wibble::exception::Regexp, and wibble::exception::BadOption.

Referenced by fullInfo().

virtual const std::string& wibble::exception::Generic::fullInfo | ( |  | ) | const
throw | ( |
| ) |  |

inline virtual

Format in a string all available information about the exception.

The formatted version is cached because this function is used to implement the default what() method, which needs to return a stable c_str() pointer.

References desc(), wibble::exception::Context::formatContext(), and m_formatted.

Referenced by TestException::badCast(), TestException::generic(), main(), TestException::system(), what(), and withCommands().

virtual const char* wibble::exception::Generic::type | ( |  | ) | const
throw | ( |
| ) |  |

inline virtual

Get a string tag identifying the exception type.

Reimplemented in wibble::exception::File, wibble::exception::System, wibble::exception::ValOutOfRange< C >, wibble::exception::OutOfRange, wibble::exception::Consistency, wibble::exception::WaitInterrupted, wibble::exception::Interrupted, wibble::exception::Regexp, and wibble::exception::BadOption.

Referenced by main().

virtual const char* wibble::exception::Generic::what | ( |  | ) | const
throw | ( |
| ) |  |

inline virtual

References fullInfo().

Referenced by TestFs::_mkdirIfMissing().

## Member Data Documentation

std::string wibble::exception::Generic::m_formatted

mutable protected

Referenced by fullInfo().

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

- exception.h