Toolbox snapshot
The Reactive C++ Toolbox
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
toolbox::util::Exception Class Reference

#include <toolbox/util/Exception.hpp>

Inheritance diagram for toolbox::util::Exception:
Inheritance graph
[legend]
Collaboration diagram for toolbox::util::Exception:
Collaboration graph
[legend]

Public Member Functions

 Exception (std::error_code ec=std::error_code())
 
 Exception (int err, const std::error_category &ecat)
 
 Exception (std::error_code ec, std::string_view what)
 
 Exception (int err, const std::error_category &ecat, std::string_view what)
 
 ~Exception () override
 
 Exception (const Exception &)=default
 
Exceptionoperator= (const Exception &)=default
 
 Exception (Exception &&) noexcept=default
 
Exceptionoperator= (Exception &&) noexcept=default
 
void to_json (std::ostream &os) const
 
const std::error_code & code () const noexcept
 Returns the error code.
 

Static Public Member Functions

static void to_json (std::ostream &os, int code, const char *message)
 
static void to_json (std::ostream &os, const std::error_code &code, const char *message)
 

Detailed Description

Definition at line 30 of file Exception.hpp.

Constructor & Destructor Documentation

◆ Exception() [1/6]

toolbox::util::Exception::Exception ( std::error_code  ec = std::error_code())
explicit

Definition at line 26 of file Exception.cpp.

◆ Exception() [2/6]

toolbox::util::Exception::Exception ( int  err,
const std::error_category &  ecat 
)

Definition at line 32 of file Exception.cpp.

◆ Exception() [3/6]

toolbox::util::Exception::Exception ( std::error_code  ec,
std::string_view  what 
)

Definition at line 37 of file Exception.cpp.

◆ Exception() [4/6]

toolbox::util::Exception::Exception ( int  err,
const std::error_category &  ecat,
std::string_view  what 
)

Definition at line 43 of file Exception.cpp.

◆ ~Exception()

toolbox::util::Exception::~Exception ( )
overridedefault

◆ Exception() [5/6]

toolbox::util::Exception::Exception ( const Exception )
default

◆ Exception() [6/6]

toolbox::util::Exception::Exception ( Exception &&  )
defaultnoexcept

Member Function Documentation

◆ operator=() [1/2]

Exception & toolbox::util::Exception::operator= ( const Exception )
default

◆ operator=() [2/2]

Exception & toolbox::util::Exception::operator= ( Exception &&  )
defaultnoexcept

◆ to_json() [1/3]

void toolbox::util::Exception::to_json ( std::ostream &  os,
int  code,
const char message 
)
static

Format exception as a OpenAPI JSON response message.

Parameters
osThe output stream.
codeThe error code.
messageThe error Message.

Definition at line 50 of file Exception.cpp.

◆ to_json() [2/3]

static void toolbox::util::Exception::to_json ( std::ostream &  os,
const std::error_code &  code,
const char message 
)
inlinestatic

Format exception as a OpenAPI JSON response message.

Parameters
osThe output stream.
codeThe error code.
messageThe error Message.

Definition at line 56 of file Exception.hpp.

◆ to_json() [3/3]

void toolbox::util::Exception::to_json ( std::ostream &  os) const
inline

Format exception as a OpenAPI JSON response message.

Parameters
osThe output stream.

Definition at line 63 of file Exception.hpp.

Referenced by to_json().

◆ code()

const std::error_code & toolbox::util::Exception::code ( ) const
inlinenoexcept

Returns the error code.

Definition at line 66 of file Exception.hpp.

Referenced by to_json().


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