Astarte device API for C++ 0.8.1
Astarte device SDK for C++
Loading...
Searching...
No Matches
AstarteDeviceSdk::AstarteErrorBase Class Reference

Base error class representing any possible error from the Astarte device library. More...

#include <errors.hpp>

+ Inheritance diagram for AstarteDeviceSdk::AstarteErrorBase:

Public Member Functions

virtual ~AstarteErrorBase ()
 Destructor for the Astarte error.
 
auto message () const -> const std::string &
 Return the message encapsulated in the error.
 
auto type () const -> const std::string &
 Return the type encapsulated in the error.
 
auto nested_error () const -> const std::shared_ptr< AstarteErrorBase > &
 Return the nested error.
 

Protected Member Functions

 AstarteErrorBase (std::string_view type, std::string_view message)
 Constructor for the Astarte error.
 
 AstarteErrorBase (std::string_view type, std::string_view message, const AstarteErrorBase &other)
 Wrapping constructor for the Astarte error.
 

Detailed Description

Base error class representing any possible error from the Astarte device library.

This type is intended to be used as the error type 'E' in std::expected<T, E>.

Constructor & Destructor Documentation

◆ ~AstarteErrorBase()

virtual AstarteDeviceSdk::AstarteErrorBase::~AstarteErrorBase ( )
virtual

Destructor for the Astarte error.

◆ AstarteErrorBase() [1/2]

AstarteDeviceSdk::AstarteErrorBase::AstarteErrorBase ( std::string_view type,
std::string_view message )
explicitprotected

Constructor for the Astarte error.

Parameters
typeThe name of the error type.
messageThe error message.

◆ AstarteErrorBase() [2/2]

AstarteDeviceSdk::AstarteErrorBase::AstarteErrorBase ( std::string_view type,
std::string_view message,
const AstarteErrorBase & other )
explicitprotected

Wrapping constructor for the Astarte error.

Parameters
typeThe name of the error type.
messageThe error message.
otherAn error to encapsulate within this base error.

Member Function Documentation

◆ message()

auto AstarteDeviceSdk::AstarteErrorBase::message ( ) const -> const std::string &

Return the message encapsulated in the error.

Returns
The error message.

◆ nested_error()

auto AstarteDeviceSdk::AstarteErrorBase::nested_error ( ) const -> const std::shared_ptr< AstarteErrorBase > &

Return the nested error.

Returns
The error.

◆ type()

auto AstarteDeviceSdk::AstarteErrorBase::type ( ) const -> const std::string &

Return the type encapsulated in the error.

Returns
The error type.

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