5#include "errors/impl/error_with_cause.hpp"
51 , message(std::move(msg))
55 const char *
what() const noexcept
override
57 return this->message.has_value() ? this->message->c_str() :
"";
61 std::optional<std::string> message;
63static_assert(!std::is_abstract<wrap_error>());
Smart pointer to errors::error with some utility member functions.
Definition error_ptr.hpp:13
A base error class.
Definition error_with_cause.hpp:19
const error_ptr & cause() const &noexcept override
Get cause of this error, if any.
Definition error_with_cause.hpp:35
An error which wraps another error.
Definition wrap_error.hpp:23
const char * what() const noexcept override
Get error message.
Definition wrap_error.hpp:55
wrap_error(error_ptr &&cause, source_location loc)
Constructor with cause and source_location.
Definition wrap_error.hpp:33
wrap_error(std::string msg, error_ptr &&cause, source_location loc)
Constructor with message, cause and source_location.
Definition wrap_error.hpp:49
The source location.
Definition source_location.hpp:46