errors 0.6.3
Loading...
Searching...
No Matches
errors::impl::exception_error Class Reference

An error that has an exception. More...

#include <errors/impl/exception_error.hpp>

Inheritance diagram for errors::impl::exception_error:
Collaboration diagram for errors::impl::exception_error:

Public Member Functions

 exception_error (std::exception_ptr exception, source_location location)
 Create an exception error from an exception pointer.
 
 exception_error (source_location location)
 Create an exception error from the current exception.
 
const char * what () const noexcept override
 Get the exception message.
 
- Public Member Functions inherited from errors::impl::error_without_cause
const error_ptrcause () const &noexcept override
 Get cause of this error, if any.
 
error_ptr cause () &&noexcept override
 Transfer the ownership of cause of this error, if any.
 
 base_error (source_location loc)
 Constructor with source_location.
 
- Public Member Functions inherited from errors::impl::base_error
 base_error (source_location loc)
 Constructor with source_location.
 
std::optional< source_locationlocation () const noexcept override
 Get the source location of this error, if any.
 
- Public Member Functions inherited from errors::error
- Public Member Functions inherited from errors::detail::interface
 interface (const interface &)=delete
 
 interface (interface &&)=delete
 
interfaceoperator= (interface &&)=delete
 
interfaceoperator= (const interface &)=delete
 

Public Attributes

std::exception_ptr exception_ptr
 The exception pointer.
 

Detailed Description

An error that has an exception.

This class is used to create an error from an exception.

Constructor & Destructor Documentation

◆ exception_error() [1/2]

errors::impl::exception_error::exception_error ( std::exception_ptr exception,
source_location location )
inline

Create an exception error from an exception pointer.

Parameters
exceptionThe exception pointer.
locationThe source location.

The exception pointer is stored in the error.

◆ exception_error() [2/2]

errors::impl::exception_error::exception_error ( source_location location)
inline

Create an exception error from the current exception.

Parameters
locationThe source location.

Member Function Documentation

◆ what()

const char * errors::impl::exception_error::what ( ) const
inlineoverridevirtualnoexcept

Get the exception message.

Returns
The exception message. If the exception is not set, an empty string is returned.

Implements errors::error.


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