8 #ifndef BOOSTER_SYSTEM_ERROR_H 9 #define BOOSTER_SYSTEM_ERROR_H 12 #include <booster/backtrace.h> 15 #include <booster/config.h> 42 virtual char const *
name()
const = 0;
46 virtual std::string
message(
int ev)
const = 0;
58 return std::less<error_category const *>()(
this,&other);
64 BOOSTER_UNUSED
static const error_category &system_category = get_system_category();
68 BOOSTER_UNUSED
static const error_category &windows_category = get_system_category();
73 BOOSTER_UNUSED
static const error_category &posix_category = get_system_category();
90 category_(&system_category)
120 return std::string(category_->name()) +
": " + category_->message(value_);
125 operator bool ()
const 146 return !(left==right);
188 std::string(category.
name())
189 +
": " + category.message(ev)
201 std::string(category.
name())
202 +
": " + category.message(ev)
214 std::string(category.
name())
system_error(int ev, error_category const &category)
Definition: system_error.h:212
std::string message() const
Definition: system_error.h:118
const error_category & category() const
Definition: system_error.h:111
Same as std::runtime_error but records stack trace.
Definition: backtrace.h:158
system_error(error_code const &e)
Definition: system_error.h:161
error_code(int val, error_category const &cat)
Definition: system_error.h:96
system_error(error_code const &e, char const *message)
Definition: system_error.h:177
The lightweight object that carries a error code information and its category.
Definition: system_error.h:83
system_error(int ev, error_category const &category, char const *message)
Definition: system_error.h:186
this class represents a category of errors.
Definition: system_error.h:34
error_code()
Definition: system_error.h:88
int value() const
Definition: system_error.h:104
system_error(error_code const &e, std::string const &message)
Definition: system_error.h:169
virtual std::string message(int ev) const =0
system_error(int ev, error_category const &category, std::string const &message)
Definition: system_error.h:199
virtual char const * name() const =0
error_code const & code() const
Definition: system_error.h:223
Booster library namespace. The library that implements Boost Like API in ABI backward compatible way...
Definition: application.h:23
This is the object that should be thrown in case of the error.
Definition: system_error.h:156