LuciadCPillar  2021.0
luciad::ErrorInfo Class Referencefinal

This class exposes details for a failed method call returning a luciad::expected. More...

Public Member Functions

 ErrorInfo (ErrorCode errorCode, const std::string &message="")
 
 ErrorInfo (std::error_code errorCode, const std::string &message="")
 
 ~ErrorInfo ()=default
 
std::error_code getErrorCode () const
 
std::string getMessage () const
 
bool operator!= (const std::error_code &errorCode) const
 
bool operator!= (const std::error_condition &errorCondition) const
 
bool operator== (const std::error_code &errorCode) const
 Enable the ErrorInfo to be compared against an std::error_code. More...
 
bool operator== (const std::error_condition &errorCondition) const
 

Detailed Description

This class exposes details for a failed method call returning a luciad::expected.

It contains :

  • An error message explaining why the call failed.
  • An error code (see std::error_code).

Related article: Error handling conventions used in the API

Remarks
This ErrorInfo will be translated to a C# Exception when used in a C# context. The exception type depends on the context of the call, please refer to the related documentation.

Constructor & Destructor Documentation

◆ ErrorInfo() [1/2]

luciad::ErrorInfo::ErrorInfo ( std::error_code  errorCode,
const std::string &  message = "" 
)
inlineexplicit
Parameters
errorCodeThe error's code.
messageThe error's message.

◆ ErrorInfo() [2/2]

luciad::ErrorInfo::ErrorInfo ( ErrorCode  errorCode,
const std::string &  message = "" 
)
inlineexplicit

◆ ~ErrorInfo()

luciad::ErrorInfo::~ErrorInfo ( )
default

Member Function Documentation

◆ getErrorCode()

std::error_code luciad::ErrorInfo::getErrorCode ( ) const
inline
Returns
the error's code.

◆ getMessage()

std::string luciad::ErrorInfo::getMessage ( ) const
inline
Returns
the error's message.

◆ operator!=() [1/2]

bool luciad::ErrorInfo::operator!= ( const std::error_code &  errorCode) const
inline

◆ operator!=() [2/2]

bool luciad::ErrorInfo::operator!= ( const std::error_condition &  errorCondition) const
inline

◆ operator==() [1/2]

bool luciad::ErrorInfo::operator== ( const std::error_code &  errorCode) const
inline

Enable the ErrorInfo to be compared against an std::error_code.

◆ operator==() [2/2]

bool luciad::ErrorInfo::operator== ( const std::error_condition &  errorCondition) const
inline