An extension of std::exception providing support for formatted error messages. Exceptions should always be catched via "catch (const std::exception& ex)", and thrown by value (Just use builtin static throw functions)
More...
#include <foray_exception.hpp>
|
| Exception () |
|
| Exception (std::string_view reason) |
|
template<typename... Args> |
| Exception (const char *const format, Args &&... args) |
|
virtual const char * | what () const noexcept override |
|
|
static void | Throw (std::string_view reason, const source_location location=source_location::current()) |
| Throws an exception.
|
|
template<typename... Args> |
static void | Throw (const source_location location, const char *const format, Args &&... args) |
| Throws an exception.
|
|
|
std::string | mReason = std::string("") |
|
An extension of std::exception providing support for formatted error messages. Exceptions should always be catched via "catch (const std::exception& ex)", and thrown by value (Just use builtin static throw functions)
◆ Exception() [1/3]
foray::Exception::Exception |
( |
| ) |
|
|
inline |
◆ Exception() [2/3]
foray::Exception::Exception |
( |
std::string_view |
reason | ) |
|
|
inlineexplicit |
◆ Exception() [3/3]
template<typename... Args>
foray::Exception::Exception |
( |
const char *const |
format, |
|
|
Args &&... |
args |
|
) |
| |
|
inline |
◆ Throw() [1/2]
template<typename... Args>
static void foray::Exception::Throw |
( |
const source_location |
location, |
|
|
const char *const |
format, |
|
|
Args &&... |
args |
|
) |
| |
|
inlinestatic |
Throws an exception.
All throwing should be values, catch via "const std::exception& ex".
- Parameters
-
reason | User defined error message |
location | source location |
args | format args |
◆ Throw() [2/2]
static void foray::Exception::Throw |
( |
std::string_view |
reason, |
|
|
const source_location |
location = source_location::current() |
|
) |
| |
|
static |
Throws an exception.
All throwing should be values, catch via "const std::exception& ex".
- Parameters
-
reason | User defined error message |
location | Automatically generated source location |
◆ what()
virtual const char * foray::Exception::what |
( |
| ) |
const |
|
inlineoverridevirtualnoexcept |
◆ mReason
std::string foray::Exception::mReason = std::string("") |
|
protected |
The documentation for this class was generated from the following file: