| D++ (DPP) C++ Discord API Bot Library

Search
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:
[legend]
Collaboration diagram for dpp::exception:
[legend]

## 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.
exception & | operator= (const exception &)=default
| Copy assignment operator.
exception & | operator= (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 | ) |

inline explicit

Construct a new exception object.

Parameters

  what | reason message

## ◆ exception() [3/10]

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

inline explicit

Construct a new exception object.

Parameters

  what | reason message
  code | Exception code

## ◆ exception() [4/10]

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

inline

Construct a new exception object.

Parameters

  what | reason message
  len | length of reason message

## ◆ exception() [5/10]

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

inline explicit

Construct a new exception object.

Parameters

  what | reason message

## ◆ exception() [6/10]

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

inline explicit

Construct a new exception object.

Parameters

  what | reason message
  code | Exception code

## ◆ exception() [7/10]

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

inline explicit

Construct a new exception object.

Parameters

  what | reason message

## ◆ exception() [8/10]

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

inline explicit

Construct a new exception object.

Parameters

  what | reason message
  code | Exception 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 | ( |  | ) |

override default

Destroy the exception object.

## Member Function Documentation

## ◆ code()

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

inline nodiscard noexcept

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

inline nodiscard override noexcept

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.13 D++ Library version 9.0.12 D++ Library version 9.0.11 D++ Library version 9.0.10 D++ Library version 9.0.9 D++ Library version 9.0.8 D++ Library version 9.0.7 D++ Library version 9.0.6 D++ Library version 9.0.5 D++ Library version 9.0.4 D++ Library version 9.0.3 D++ Library version 9.0.2 D++ Library version 9.0.1 D++ Library version 9.0.0 D++ Library version 1.0.2 D++ Library version 1.0.1 D++ Library version 1.0.0