errors 0.6.3
|
An error which wraps another error. More...
#include <errors/impl/wrap_error.hpp>
Public Member Functions | |
wrap_error (error_ptr &&cause, source_location loc) | |
Constructor with cause and source_location. | |
wrap_error (std::string msg, error_ptr &&cause, source_location loc) | |
Constructor with message, cause and source_location. | |
const char * | what () const noexcept override |
Get error message. | |
![]() | |
error_with_cause (error_ptr &&cause, source_location loc) | |
Constructor with source_location. | |
const error_ptr & | cause () 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. | |
std::optional< source_location > | location () const noexcept override |
Get the source location of this error, if any. | |
![]() | |
![]() | |
interface (const interface &)=delete | |
interface (interface &&)=delete | |
interface & | operator= (interface &&)=delete |
interface & | operator= (const interface &)=delete |
An error which wraps another error.
This error is used to wrap another error with an optional message. If the message is not provided, the only extra information that this error will records is the source location.
|
inline |
Constructor with cause and source_location.
cause | The cause of the error. |
loc | The source location. |
|
inline |
Constructor with message, cause and source_location.
msg | The error message. |
cause | The cause of the error. |
loc | The source location. |
|
inlineoverridevirtualnoexcept |
Get error message.
NULL
, but it can be an empty string.This method works just like std::exception::what
, you should print all the context which is useful for debugging in this method except for the source location.
Implements errors::error.