Woman, Life, Freedom


Adaptive AUTOSAR
ARA public interface header documentation
ara::core::ErrorCode Class Referencefinal

A wrapper around the raw error code in a specific ErrorDomain. More...

#include <error_code.h>

Public Member Functions

constexpr ErrorCode (ErrorDomain::CodeType value, const ErrorDomain &domain) noexcept
 Constructor. More...
 
constexpr ErrorDomain::CodeType Value () const noexcept
 Get error code value. More...
 
constexpr ErrorDomain const & Domain () const noexcept
 Get error code domain. More...
 
std::string Message () const noexcept
 Get error message. More...
 
void ThrowAsException () const
 Throw the error as an exception.
 
constexpr bool operator== (const ErrorCode &other) const noexcept
 
constexpr bool operator!= (const ErrorCode &other) const noexcept
 

Detailed Description

A wrapper around the raw error code in a specific ErrorDomain.

Constructor & Destructor Documentation

◆ ErrorCode()

constexpr ara::core::ErrorCode::ErrorCode ( ErrorDomain::CodeType  value,
const ErrorDomain domain 
)
inlineconstexprnoexcept

Constructor.

Parameters
valueError code value
domainError code domain

Member Function Documentation

◆ Domain()

constexpr ErrorDomain const & ara::core::ErrorCode::Domain ( ) const
inlineconstexprnoexcept

Get error code domain.

Returns
Error domain which the error code belongs to

◆ Message()

std::string ara::core::ErrorCode::Message ( ) const
noexcept

Get error message.

Returns
Error code corresponding message in the defined domain

◆ Value()

constexpr ErrorDomain::CodeType ara::core::ErrorCode::Value ( ) const
inlineconstexprnoexcept

Get error code value.

Returns
Raw error code value