sbuild
1.7.1
|
Error exception class. More...
#include <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 (const std::string &error) | |
The constructor. More... | |
error (const std::string &error, const std::string &reason) | |
The constructor. More... | |
virtual | ~error () throw () |
The destructor. | |
template<typename A , typename B , typename C , typename D , typename E , typename F > | |
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) |
template<typename A , typename B , typename C , typename D , typename E , typename F > | |
std::string | format_error (A const &context1, B const &context2, C const &context3, const std::runtime_error &error, D const &detail1, E const &detail2, F const &detail3) |
template<typename A > | |
void | add_detail (boost::format &fmt, A const &value) |
template<typename A , typename B , typename C , typename R , typename D , typename E , typename F > | |
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) |
template<typename A > | |
void | add_reason (std::string &reason, A const &value) |
![]() | |
virtual | ~error_base () throw () |
The destructor. | |
virtual const char * | why () const throw () |
Get the reason for the error. More... | |
std::string const & | get_reason () const |
Get the reason for the error. More... | |
void | set_reason (const std::string &reason) |
Set the reason for the error. More... | |
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. More... | |
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, const std::runtime_error &error, D const &detail1, E const &detail2, F const &detail3) |
Format an error message. More... | |
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. More... | |
static void | add_detail (boost::format &fmt, const std::nullptr_t &value) |
Add detail to format string. More... | |
template<typename A > | |
static void | add_detail (boost::format &fmt, A const &value) |
Add detail to format string. More... | |
template<typename A > | |
static void | add_reason (std::string &reason, A const &value) |
Add reason to reason string. More... | |
Private Member Functions | |
template<> | |
error< ctty_error_code >::map_type | error_strings |
template<> | |
error< keyfile::error_code > ::map_type | error_strings |
template<> | |
error< lock::error_code >::map_type | error_strings |
template<> | |
error< mntstream::error_code > ::map_type | error_strings |
template<> | |
error< parse_value_error_code > ::map_type | error_strings |
template<> | |
error < sbuild::personality::error_code > ::map_type | error_strings |
template<> | |
error< run_parts::error_code > ::map_type | error_strings |
template<> | |
error< session::error_code > ::map_type | error_strings |
template<> | |
error< stat::error_code >::map_type | error_strings |
Static Private Member Functions | |
static const char * | get_error (error_type error) |
Get a translated error string. More... | |
Static Private Attributes | |
static map_type | error_strings |
Mapping between error code and string. | |
Additional Inherited Members | |
![]() | |
error_base (const std::string &error) | |
The constructor. More... | |
error_base (const std::string &error, const std::string &reason) | |
The constructor. More... | |
Error exception class.
|
inline |
The constructor.
error | the error message. |
|
inline |
The constructor.
error | the error message. |
reason | further information about the error |
|
inlinestaticprotected |
Add detail to format string.
Specialised for nullptr. Current versions of boost::format don't like nullptr.
fmt | the format string. |
value | the value to add. |
|
staticprotected |
Add detail to format string.
fmt | the format string. |
value | the value to add. |
|
staticprotected |
Add reason to reason string.
reason | the reason string. |
value | the value to add. |
|
staticprotected |
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. |
|
staticprotected |
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. |
|
staticprotected |
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. |
|
inlinestaticprivate |
Get a translated error string.
error | the error code. |
References sbuild::gettext().