Error exception class.
More...
#include <sbuild-error.h>
|
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.
|
|
|
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, std::runtime_error const &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...
|
|
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...
|
|
template<typename T>
class sbuild::error< T >
Error exception class.
The constructor.
- Parameters
-
The constructor.
- Parameters
-
error | the error message. |
reason | further information about the error |
template<typename T>
template<typename A >
static void sbuild::error< T >::add_detail |
( |
boost::format & |
fmt, |
|
|
A const & |
value |
|
) |
| |
|
staticprotected |
Add detail to format string.
- Parameters
-
fmt | the format string. |
value | the value to add. |
template<typename T>
template<typename A >
static void sbuild::error< T >::add_reason |
( |
std::string & |
reason, |
|
|
A const & |
value |
|
) |
| |
|
staticprotected |
Add reason to reason string.
- Parameters
-
reason | the reason string. |
value | the value to add. |
template<typename T>
template<typename A , typename B , typename C , typename D , typename E , typename F >
static 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 |
|
) |
| |
|
staticprotected |
Format an error message.
- Parameters
-
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. |
- Returns
- a translated error message.
- Todo:
- Merge the logic shared between the two specialisations to prevent code duplication.
template<typename T>
template<typename A , typename B , typename C , typename D , typename E , typename F >
static 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 |
|
) |
| |
|
staticprotected |
Format an error message.
- Parameters
-
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. |
- Returns
- a translated error message.
template<typename T>
template<typename A , typename B , typename C , typename R , typename D , typename E , typename F >
static 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 |
|
) |
| |
|
staticprotected |
Format an reason string.
- Parameters
-
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. |
- Returns
- a translated error message.
Get a translated error string.
- Parameters
-
- Returns
- a translated error string.
The documentation for this class was generated from the following file: