D++ (DPP)
C++ Discord API Bot Library
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...

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

Public Member Functions

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

Protected Attributes

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

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
inlinenoexcept

Get exception code.

Returns
exception_error_code error code

◆ what()

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

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