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

A base error class. More...

#include <errors/impl/base_error.hpp>

Inheritance diagram for errors::impl::base_error:
Collaboration diagram for errors::impl::base_error:

Public Member Functions

 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
virtual const char * what () const noexcept=0
 Get error message.
 
virtual const error_ptrcause () const &noexcept=0
 Get cause of this error, if any.
 
virtual error_ptr cause () &&noexcept=0
 Transfer the ownership of cause of this error, if any.
 
- Public Member Functions inherited from errors::detail::interface
 interface (const interface &)=delete
 
 interface (interface &&)=delete
 
interfaceoperator= (interface &&)=delete
 
interfaceoperator= (const interface &)=delete
 

Detailed Description

A base error class.

It implements the location method for all other builtin error types to derived from.

Constructor & Destructor Documentation

◆ base_error()

errors::impl::base_error::base_error ( source_location loc)
inline

Constructor with source_location.

Parameters
locThe source location.

Member Function Documentation

◆ location()

std::optional< source_location > errors::impl::base_error::location ( ) const
inlineoverridevirtualnoexcept

Get the source location of this error, if any.

Returns
An optional source location.

This method returns the source location where this error is generated, if it is available.

Implements errors::error.


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