D++ (DPP)  10.0.30
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...

#include "exception.h"

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

Protected Attributes

exception_error_code error_code
 Exception error code. More...
 
std::string msg
 Exception message. 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

References msg.

◆ 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

Referenced by main().

Here is the caller graph for this function:

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.

Referenced by exception().


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