libmdbx  0.11.6.39 (2022-04-13T11:05:50+03:00)
One of the fastest compact embeddable key-value ACID database without WAL.
mdbx::error Class Reference

Implements error information and throwing corresponding exceptions. More...

#include <mdbx.h++>

Public Member Functions

MDBX_CXX11_CONSTEXPR error (MDBX_error_t error_code) noexcept
 
 error (const error &)=default
 
 error (error &&)=default
 
erroroperator= (const error &)=default
 
erroroperator= (error &&)=default
 
MDBX_CXX11_CONSTEXPR bool is_success () const noexcept
 
MDBX_CXX11_CONSTEXPR bool is_result_true () const noexcept
 
MDBX_CXX11_CONSTEXPR bool is_result_false () const noexcept
 
MDBX_CXX11_CONSTEXPR bool is_failure () const noexcept
 
MDBX_CXX11_CONSTEXPR MDBX_error_t code () const noexcept
 Returns error code. More...
 
const char * what () const noexcept
 Returns message for MDBX's errors only and "SYSTEM" for others. More...
 
::std::string message () const
 Returns message for any errors. More...
 
MDBX_CXX11_CONSTEXPR bool is_mdbx_error () const noexcept
 Returns true for MDBX's errors. More...
 
void panic (const char *context_where_when, const char *func_who_what) const noexcept
 Panics on unrecoverable errors inside destructors etc. More...
 
void throw_exception () const
 
void throw_on_failure () const
 
void success_or_throw () const
 
void success_or_throw (const exception_thunk &) const
 
void panic_on_failure (const char *context_where, const char *func_who) const noexcept
 
void success_or_panic (const char *context_where, const char *func_who) const noexcept
 

Static Public Member Functions

static void throw_exception (int error_code)
 
static void throw_on_nullptr (const void *ptr, MDBX_error_t error_code)
 
static void success_or_throw (MDBX_error_t error_code)
 
static void success_or_throw (int error_code)
 
static void throw_on_failure (int error_code)
 
static bool boolean_or_throw (int error_code)
 
static void success_or_throw (int error_code, const exception_thunk &)
 
static void panic_on_failure (int error_code, const char *context_where, const char *func_who) noexcept
 
static void success_or_panic (int error_code, const char *context_where, const char *func_who) noexcept
 

Friends

MDBX_CXX11_CONSTEXPR friend bool operator== (const error &a, const error &b) noexcept
 
MDBX_CXX11_CONSTEXPR friend bool operator!= (const error &a, const error &b) noexcept
 

Detailed Description

Implements error information and throwing corresponding exceptions.

Constructor & Destructor Documentation

◆ error() [1/3]

MDBX_CXX11_CONSTEXPR mdbx::error::error ( MDBX_error_t  error_code)
noexcept

◆ error() [2/3]

mdbx::error::error ( const error )
default

◆ error() [3/3]

mdbx::error::error ( error &&  )
default

Member Function Documentation

◆ boolean_or_throw()

bool mdbx::error::boolean_or_throw ( int  error_code)
inlinestatic

◆ code()

MDBX_CXX11_CONSTEXPR MDBX_error_t mdbx::error::code ( ) const
noexcept

Returns error code.

◆ is_failure()

MDBX_CXX11_CONSTEXPR bool mdbx::error::is_failure ( ) const
noexcept

◆ is_mdbx_error()

MDBX_CXX11_CONSTEXPR bool mdbx::error::is_mdbx_error ( ) const
noexcept

Returns true for MDBX's errors.

◆ is_result_false()

MDBX_CXX11_CONSTEXPR bool mdbx::error::is_result_false ( ) const
noexcept

◆ is_result_true()

MDBX_CXX11_CONSTEXPR bool mdbx::error::is_result_true ( ) const
noexcept

◆ is_success()

MDBX_CXX11_CONSTEXPR bool mdbx::error::is_success ( ) const
noexcept

◆ message()

::std::string mdbx::error::message ( ) const

Returns message for any errors.

◆ operator=() [1/2]

error& mdbx::error::operator= ( const error )
default

◆ operator=() [2/2]

error& mdbx::error::operator= ( error &&  )
default

◆ panic()

void mdbx::error::panic ( const char *  context_where_when,
const char *  func_who_what 
) const
noexcept

Panics on unrecoverable errors inside destructors etc.

◆ panic_on_failure() [1/2]

void mdbx::error::panic_on_failure ( const char *  context_where,
const char *  func_who 
) const
inlinenoexcept

◆ panic_on_failure() [2/2]

void mdbx::error::panic_on_failure ( int  error_code,
const char *  context_where,
const char *  func_who 
)
inlinestaticnoexcept

◆ success_or_panic() [1/2]

void mdbx::error::success_or_panic ( const char *  context_where,
const char *  func_who 
) const
inlinenoexcept

◆ success_or_panic() [2/2]

void mdbx::error::success_or_panic ( int  error_code,
const char *  context_where,
const char *  func_who 
)
inlinestaticnoexcept

◆ success_or_throw() [1/5]

void mdbx::error::success_or_throw ( ) const
inline

◆ success_or_throw() [2/5]

void mdbx::error::success_or_throw ( const exception_thunk thunk) const
inline

◆ success_or_throw() [3/5]

static void mdbx::error::success_or_throw ( int  error_code)
inlinestatic

◆ success_or_throw() [4/5]

void mdbx::error::success_or_throw ( int  error_code,
const exception_thunk thunk 
)
inlinestatic

◆ success_or_throw() [5/5]

void mdbx::error::success_or_throw ( MDBX_error_t  error_code)
inlinestatic

◆ throw_exception() [1/2]

void mdbx::error::throw_exception ( ) const

◆ throw_exception() [2/2]

void mdbx::error::throw_exception ( int  error_code)
inlinestatic

◆ throw_on_failure() [1/2]

void mdbx::error::throw_on_failure ( ) const
inline

◆ throw_on_failure() [2/2]

void mdbx::error::throw_on_failure ( int  error_code)
inlinestatic

◆ throw_on_nullptr()

void mdbx::error::throw_on_nullptr ( const void *  ptr,
MDBX_error_t  error_code 
)
inlinestatic

◆ what()

const char* mdbx::error::what ( ) const
noexcept

Returns message for MDBX's errors only and "SYSTEM" for others.

Friends And Related Function Documentation

◆ operator!=

MDBX_CXX11_CONSTEXPR friend bool operator!= ( const error a,
const error b 
)
friend

◆ operator==

MDBX_CXX11_CONSTEXPR friend bool operator== ( const error a,
const error b 
)
friend

The documentation for this class was generated from the following file: