errors 0.6.3
Loading...
Searching...
No Matches
errors::wrap Class Reference

A function like class to wrap an error. More...

#include <errors/wrap.hpp>

Inheritance diagram for errors::wrap:
Collaboration diagram for errors::wrap:

Public Member Functions

 wrap (std::string message, error_ptr &&cause, source_location location=source_location::current())
 Wraps an error with an optional message.
 
 wrap (error_ptr &&cause, source_location location=source_location::current())
 Wraps an error.
 
- Public Member Functions inherited from errors::error_ptr
template<typename E >
bool is () const
 Check if the error is caused by some kind of errors::error recursively.
 
template<typename E >
const E * as () const
 Looking up error in causes.
 
template<typename E >
E * as ()
 Looking up error in causes.
 

Detailed Description

A function like class to wrap an error.

See also
wrap()
Examples
examples/basic-usage/src/main.cpp.

Constructor & Destructor Documentation

◆ wrap()

errors::wrap::wrap ( std::string message,
error_ptr && cause,
source_location location = source_location::current() )
inline

Wraps an error with an optional message.

This class is used to quickly wrap an error with an optional message. It is equivalent to errors::make<wrap_error>::with(...).

See also
errors::impl::wrap_error
errors::make::with

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