sbuild 1.4.23
|
Error exception class. More...
#include <sbuild-error.h>
Classes | |
struct | add_detail_helper |
Helper class to add detail to format string. More... | |
struct | add_detail_helper< A, true > |
Helper class to add detail to format string. More... | |
struct | add_reason_helper |
Helper class to add reason to reason string. More... | |
struct | add_reason_helper< A, true > |
Helper class to add reason to reason string. More... | |
Public Types | |
typedef T | error_type |
The enum type providing the error codes for this type. | |
typedef std::map< error_type, const char * > | map_type |
Mapping between error code and error description. | |
Public Member Functions | |
error (std::string const &error) | |
The constructor. | |
error (std::string const &error, std::string const &reason) | |
The constructor. | |
virtual | ~error () throw () |
The destructor. | |
Static Protected Member Functions | |
template<typename A , typename B , typename C , typename D , typename E , typename F > | |
static std::string | format_error (A const &context1, B const &context2, C const &context3, error_type error, D const &detail1, E const &detail2, F const &detail3) |
Format an error message. | |
template<typename A , typename B , typename C , typename D , typename E , typename F > | |
static std::string | format_error (A const &context1, B const &context2, C const &context3, std::runtime_error const &error, D const &detail1, E const &detail2, F const &detail3) |
Format an error message. | |
template<typename A , typename B , typename C , typename R , typename D , typename E , typename F > | |
static std::string | format_reason (A const &context1, B const &context2, C const &context3, R const &error, D const &detail1, E const &detail2, F const &detail3) |
Format an reason string. | |
template<typename A > | |
static void | add_detail (boost::format &fmt, A const &value) |
Add detail to format string. | |
template<typename A > | |
static void | add_reason (std::string &reason, A const &value) |
Add reason to reason string. | |
Static Private Member Functions | |
static const char * | get_error (error_type error) |
Get a translated error string. | |
Static Private Attributes | |
static map_type | error_strings |
Mapping between error code and string. |
Error exception class.
sbuild::error< T >::error | ( | std::string const & | error | ) | [inline] |
The constructor.
error | the error message. |
sbuild::error< T >::error | ( | std::string const & | error, |
std::string const & | reason | ||
) | [inline] |
The constructor.
error | the error message. |
reason | further information about the error |
void sbuild::error< T >::add_detail | ( | boost::format & | fmt, |
A const & | value | ||
) | [inline, static, protected] |
Add detail to format string.
fmt | the format string. |
value | the value to add. |
void sbuild::error< T >::add_reason | ( | std::string & | reason, |
A const & | value | ||
) | [inline, static, protected] |
Add reason to reason string.
reason | the reason string. |
value | the value to add. |
std::string sbuild::error< T >::format_error | ( | A const & | context1, |
B const & | context2, | ||
C const & | context3, | ||
error_type | error, | ||
D const & | detail1, | ||
E const & | detail2, | ||
F const & | detail3 | ||
) | [inline, static, protected] |
Format an error message.
context1 | context of the error. |
context2 | additional context of the error. |
context3 | additional context of the error. |
error | the error code. |
detail1 | details of the error. |
detail2 | additional details of the error. |
detail3 | additional details of the error. |
std::string sbuild::error< T >::format_error | ( | A const & | context1, |
B const & | context2, | ||
C const & | context3, | ||
std::runtime_error< T > const & | error, | ||
D const & | detail1, | ||
E const & | detail2, | ||
F const & | detail3 | ||
) | [inline, static, protected] |
Format an error message.
context1 | context of the error. |
context2 | additional context of the error. |
context3 | additional context of the error. |
error | the error code. |
detail1 | details of the error. |
detail2 | additional details of the error. |
detail3 | additional details of the error. |
std::string sbuild::error< T >::format_reason | ( | A const & | context1, |
B const & | context2, | ||
C const & | context3, | ||
R const & | error, | ||
D const & | detail1, | ||
E const & | detail2, | ||
F const & | detail3 | ||
) | [inline, static, protected] |
Format an reason string.
context1 | context of the error. |
context2 | additional context of the error. |
context3 | additional context of the error. |
error | the error or error code. |
detail1 | details of the error. |
detail2 | additional details of the error. |
detail3 | additional details of the error. |
const char * sbuild::error< T >::get_error | ( | error_type | error | ) | [inline, static, private] |
Get a translated error string.
error | the error code. |
References sbuild::gettext().