1 #ifndef WREPORT_ERROR_H 2 #define WREPORT_ERROR_H 56 #define WREPORT_THROWF_ATTRS(a, b) \ 57 __attribute__((noreturn, format(printf, a, b))) 60 class error :
public std::exception
71 const char*
what()
const noexcept
override = 0;
96 const char*
what() const noexcept
override {
return msg; }
111 const char*
what() const noexcept
override {
return msg.c_str(); }
119 using StringBase::StringBase;
132 using StringBase::StringBase;
146 using StringBase::StringBase;
156 using StringBase::StringBase;
193 using StringBase::StringBase;
203 using StringBase::StringBase;
216 static void throwf(
const char* file,
int line,
const char* fmt, ...)
236 static void throwf(
int code,
void* re,
const char* fmt, ...)
244 using StringBase::StringBase;
254 using StringBase::StringBase;
static void throwf(const char *fmt,...) WREPORT_THROWF_ATTRS(1
Throw the exception, building the message printf-style.
Report an error when parsing informations.
Definition: error.h:200
Item not found.
Definition: error.h:25
Consistency check failed.
Definition: error.h:39
static void throwf(const char *fmt,...) WREPORT_THROWF_ATTRS(1
Throw the exception, building the message printf-style.
Parse error.
Definition: error.h:41
error_system(const std::string &msg)
Create an exception taking further information from errno.
Cannot allocate memory.
Definition: error.h:29
static void throwf(const char *fmt,...) WREPORT_THROWF_ATTRS(1
Throw the exception, building the message printf-style.
Reports that memory allocation has failed.
Definition: error.h:78
Reports that a feature is still not implemented.
Definition: error.h:241
Report an error while handling regular expressions.
Definition: error.h:221
static void throwf(const char *fmt,...) WREPORT_THROWF_ATTRS(1
Throw the exception, building the message printf-style.
const char * what() const noexcept override=0
Error message.
const char * what() const noexcept override
Throw the exception, building the message printf-style.
Definition: error.h:96
virtual ErrorCode code() const noexcept=0
Exception-specific error code.
ErrorCode code() const noexcept override
Exception-specific error code.
Definition: error.h:109
No error.
Definition: error.h:23
ErrorCode code() const noexcept override
Exception-specific error code.
Definition: error.h:93
const char * msg
error message returned by what()
Definition: error.h:82
Handle management error.
Definition: error.h:33
Buffer is too short to fit data.
Definition: error.h:35
Regular expression error.
Definition: error.h:45
static void throwf(const char *fmt,...) WREPORT_THROWF_ATTRS(1
Throw the exception, building the message printf-style.
Error reported by the system.
Definition: error.h:37
error_regexp(int code, void *re, const std::string &msg)
Wrong variable type.
Definition: error.h:27
Base class for DB-All.e exceptions.
Definition: error.h:60
static void throwf(int code, void *re, const char *fmt,...) WREPORT_THROWF_ATTRS(3
Throw the exception, building the message printf-style.
static const char * strerror(ErrorCode code)
String description for an error code.
Feature not implemented.
Definition: error.h:47
ODBC error.
Definition: error.h:31
String functions.
Definition: benchmark.h:13
Report a system error message.
Definition: error.h:166
Report that a parameter is outside the acceptable domain.
Definition: error.h:251
error_parse(const char *file, int line, const std::string &msg)
static void throwf(const char *fmt,...) WREPORT_THROWF_ATTRS(1
Throw the exception, building the message printf-style.
For functions working with handles, reports a problem with handling handles, such as impossibility to...
Definition: error.h:143
Value outside acceptable domain.
Definition: error.h:49
Reports that a search-like function could not find what was requested.
Definition: error.h:116
#define WREPORT_THROWF_ATTRS(a, b)
Tell the compiler that a function always throws and expects printf-style arguments.
Definition: error.h:56
Write error.
Definition: error.h:43
std::string msg
error message returned by what()
Definition: error.h:104
ErrorCode
C-style error codes used by exceptions.
Definition: error.h:21
const char * what() const noexcept override
Error message.
Definition: error.h:111
StringBase(const std::string &msg) noexcept
Definition: error.h:107
error_alloc(const char *msg)
Definition: error.h:90
static void throwf(const char *file, int line, const char *fmt,...) WREPORT_THROWF_ATTRS(3
Throw the exception, building the message printf-style.
Report an error when a consistency check failed.
Definition: error.h:190
For functions handling data with multiple types, reports a mismatch between the type requested and th...
Definition: error.h:129
static void throwf(const char *fmt,...) WREPORT_THROWF_ATTRS(1
Throw the exception, building the message printf-style.