seams-core v2.14.0
libyodaLib, the C++ engine of d-SEAMS
Loading...
Searching...
No Matches
seams::Error Class Reference

Failure from the C API, or from a rejected argument. More...

#include <include/seams.hpp>

Inheritance diagram for seams::Error:

Public Member Functions

 Error (int status, std::string message)
 Build an error from a status and a message.
Status status () const noexcept
 Status as the Status enumeration when the code is known.
int code () const noexcept
 Status integer.

Detailed Description

Failure from the C API, or from a rejected argument.

what() is the text from seams_handle_error. code() is the status integer. The object does not own a handle.

Definition at line 177 of file seams.hpp.

Constructor & Destructor Documentation

◆ Error()

seams::Error::Error ( int status,
std::string message )
inline

Build an error from a status and a message.

Parameters
statusStatus code. Zero is not thrown by check.
messageDetail text. An empty string is allowed.

Definition at line 184 of file seams.hpp.

185 : std::runtime_error(std::move(message)), code_(status) {}
Status status() const noexcept
Status as the Status enumeration when the code is known.
Definition seams.hpp:191

Member Function Documentation

◆ code()

int seams::Error::code ( ) const
inlinenodiscardnoexcept

Status integer.

Same values as seams_status.

Returns
The code stored at construction.

Definition at line 199 of file seams.hpp.

199{ return code_; }

◆ status()

Status seams::Error::status ( ) const
inlinenodiscardnoexcept

Status as the Status enumeration when the code is known.

Returns
The matching enumerator.

Definition at line 191 of file seams.hpp.

191 {
192 return static_cast<Status>(code_);
193 }
Status
Status codes.
Definition seams.hpp:48

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