D++ (DPP)
C++ Discord API Bot Library
Loading...
Searching...
No Matches
dpp::exception Class Reference

The dpp::exception class derives from std::exception and supports some other ways of passing in error details such as via std::string. More...

#include <exception.h>

Inheritance diagram for dpp::exception:
Collaboration diagram for dpp::exception:

Public Member Functions

 exception ()=default
 Construct a new exception object.
 exception (const char *what)
 Construct a new exception object.
 exception (const char *what, size_t len)
 Construct a new exception object.
 exception (const exception &)=default
 Construct a new exception object (copy constructor).
 exception (const std::string &what)
 Construct a new exception object.
 exception (exception &&)=default
 Construct a new exception object (move constructor).
 exception (exception_error_code code, const char *what)
 Construct a new exception object.
 exception (exception_error_code code, const std::string &what)
 Construct a new exception object.
 exception (exception_error_code code, std::string &&what)
 Construct a new exception object.
 exception (std::string &&what)
 Construct a new exception object.
 ~exception () override=default
 Destroy the exception object.
exception_error_code code () const noexcept
 Get exception code.
exceptionoperator= (const exception &)=default
 Copy assignment operator.
exceptionoperator= (exception &&)=default
 Move assignment operator.
const char * what () const noexcept override
 Get exception message.

Protected Attributes

exception_error_code error_code
 Exception error code.
std::string msg
 Exception message.

Detailed Description

The dpp::exception class derives from std::exception and supports some other ways of passing in error details such as via std::string.

Constructor & Destructor Documentation

◆ exception() [1/10]

dpp::exception::exception ( )
default

Construct a new exception object.

◆ exception() [2/10]

dpp::exception::exception ( const char * what)
inlineexplicit

Construct a new exception object.

Parameters
whatreason message

◆ exception() [3/10]

dpp::exception::exception ( exception_error_code code,
const char * what )
inlineexplicit

Construct a new exception object.

Parameters
whatreason message
codeException code

◆ exception() [4/10]

dpp::exception::exception ( const char * what,
size_t len )
inline

Construct a new exception object.

Parameters
whatreason message
lenlength of reason message

◆ exception() [5/10]

dpp::exception::exception ( const std::string & what)
inlineexplicit

Construct a new exception object.

Parameters
whatreason message

◆ exception() [6/10]

dpp::exception::exception ( exception_error_code code,
const std::string & what )
inlineexplicit

Construct a new exception object.

Parameters
whatreason message
codeException code

◆ exception() [7/10]

dpp::exception::exception ( std::string && what)
inlineexplicit

Construct a new exception object.

Parameters
whatreason message

◆ exception() [8/10]

dpp::exception::exception ( exception_error_code code,
std::string && what )
inlineexplicit

Construct a new exception object.

Parameters
whatreason message
codeException code

◆ exception() [9/10]

dpp::exception::exception ( const exception & )
default

Construct a new exception object (copy constructor).

◆ exception() [10/10]

dpp::exception::exception ( exception && )
default

Construct a new exception object (move constructor).

◆ ~exception()

dpp::exception::~exception ( )
overridedefault

Destroy the exception object.

Member Function Documentation

◆ code()

exception_error_code dpp::exception::code ( ) const
inlinenodiscardnoexcept

Get exception code.

Returns
exception_error_code error code

◆ operator=() [1/2]

exception & dpp::exception::operator= ( const exception & )
default

Copy assignment operator.

Returns
exception& reference to self

◆ operator=() [2/2]

exception & dpp::exception::operator= ( exception && )
default

Move assignment operator.

Returns
exception& reference to self

◆ what()

const char * dpp::exception::what ( ) const
inlinenodiscardoverridenoexcept

Get exception message.

Returns
const char* error message

Member Data Documentation

◆ error_code

exception_error_code dpp::exception::error_code
protected

Exception error code.

◆ msg

std::string dpp::exception::msg
protected

Exception message.

D++ Library version 9.0.13D++ Library version 9.0.12D++ Library version 9.0.11D++ Library version 9.0.10D++ Library version 9.0.9D++ Library version 9.0.8D++ Library version 9.0.7D++ Library version 9.0.6D++ Library version 9.0.5D++ Library version 9.0.4D++ Library version 9.0.3D++ Library version 9.0.2D++ Library version 9.0.1D++ Library version 9.0.0D++ Library version 1.0.2D++ Library version 1.0.1D++ Library version 1.0.0