56#define WREPORT_THROWF_ATTRS(a, b) \
57 __attribute__((noreturn, format(printf, a, b)))
60class 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, ...)
244 using StringBase::StringBase;
254 using StringBase::StringBase;
Reports that memory allocation has failed.
Definition error.h:79
const char * what() const noexcept override
Throw the exception, building the message printf-style.
Definition error.h:96
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
error_alloc(const char *msg)
Definition error.h:90
Report an error when a consistency check failed.
Definition error.h:191
static void throwf(const char *fmt,...) WREPORT_THROWF_ATTRS(1
Throw the exception, building the message printf-style.
Report that a parameter is outside the acceptable domain.
Definition error.h:252
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:144
static void throwf(const char *fmt,...) WREPORT_THROWF_ATTRS(1
Throw the exception, building the message printf-style.
Reports that a search-like function could not find what was requested.
Definition error.h:117
static void throwf(const char *fmt,...) WREPORT_THROWF_ATTRS(1
Throw the exception, building the message printf-style.
static void throwf(const char *file, int line, const char *fmt,...) WREPORT_THROWF_ATTRS(3
Throw the exception, building the message printf-style.
error_parse(const char *file, int line, const std::string &msg)
error_regexp(int code, void *re, const std::string &msg)
static void throwf(int code, void *re, const char *fmt,...) WREPORT_THROWF_ATTRS(3
Throw the exception, building the message printf-style.
error_system(const std::string &msg, int errno_val)
Create an exception taking further information from an explicit errno value.
error_system(const std::string &msg)
Create an exception taking further information from errno.
static void throwf(const char *fmt,...) WREPORT_THROWF_ATTRS(1
Throw the exception, building the message printf-style.
For functions handling data with multiple types, reports a mismatch between the type requested and th...
Definition error.h:130
static void throwf(const char *fmt,...) WREPORT_THROWF_ATTRS(1
Throw the exception, building the message printf-style.
Reports that a feature is still not implemented.
Definition error.h:242
static void throwf(const char *fmt,...) WREPORT_THROWF_ATTRS(1
Throw the exception, building the message printf-style.
Base class for DB-All.e exceptions.
Definition error.h:61
virtual ErrorCode code() const noexcept=0
Exception-specific error code.
static const char * strerror(ErrorCode code)
String description for an error code.
const char * what() const noexcept override=0
Error message.
ErrorCode code() const noexcept override
Exception-specific error code.
Definition error.h:109
StringBase(const std::string &msg) noexcept
Definition error.h:107
std::string msg
error message returned by what()
Definition error.h:104
const char * what() const noexcept override
Error message.
Definition error.h:111
#define WREPORT_THROWF_ATTRS(a, b)
Tell the compiler that a function always throws and expects printf-style arguments.
Definition error.h:56
String functions.
Definition benchmark.h:13
ErrorCode
C-style error codes used by exceptions.
Definition error.h:21
@ WR_ERR_NONE
No error.
Definition error.h:23
@ WR_ERR_ODBC
ODBC error.
Definition error.h:31
@ WR_ERR_TOOLONG
Buffer is too short to fit data.
Definition error.h:35
@ WR_ERR_HANDLES
Handle management error.
Definition error.h:33
@ WR_ERR_UNIMPLEMENTED
Feature not implemented.
Definition error.h:47
@ WR_ERR_SYSTEM
Error reported by the system.
Definition error.h:37
@ WR_ERR_REGEX
Regular expression error.
Definition error.h:45
@ WR_ERR_DOMAIN
Value outside acceptable domain.
Definition error.h:49
@ WR_ERR_TYPE
Wrong variable type.
Definition error.h:27
@ WR_ERR_CONSISTENCY
Consistency check failed.
Definition error.h:39
@ WR_ERR_WRITE
Write error.
Definition error.h:43
@ WR_ERR_NOTFOUND
Item not found.
Definition error.h:25
@ WR_ERR_PARSE
Parse error.
Definition error.h:41
@ WR_ERR_ALLOC
Cannot allocate memory.
Definition error.h:29