tcalc 0.2.0
 
Loading...
Searching...
No Matches
tcalc::error::Error Class Reference

Error class. More...

#include <error.hpp>

Inheritance diagram for tcalc::error::Error:

Public Member Functions

 Error (Code code, std::string msg) noexcept
 Construct a new Error object (should be noexcept in semantic).
 
TCALC_INLINE auto code () const noexcept
 Get error code.
 
TCALC_INLINE const auto & msg () const noexcept
 Get error message.
 
void log () const noexcept
 Log error message to stderr (should be noexcept in semantic).
 
const char * what () const noexcept override
 Get error message.
 

Static Public Attributes

static constexpr std::size_t MAX_MSG_LEN = 256
 

Detailed Description

Error class.

Constructor & Destructor Documentation

◆ Error()

tcalc::error::Error::Error ( Code  code,
std::string  msg 
)
inlinenoexcept

Construct a new Error object (should be noexcept in semantic).

Parameters
codeError code.
msgError message.

Member Function Documentation

◆ code()

TCALC_INLINE auto tcalc::error::Error::code ( ) const
inlinenoexcept

Get error code.

Returns
Error code.

◆ msg()

TCALC_INLINE const auto & tcalc::error::Error::msg ( ) const
inlinenoexcept

Get error message.

Returns
Error message.

◆ what()

const char * tcalc::error::Error::what ( ) const
inlineoverridenoexcept

Get error message.

Returns
const char* Error message.

Member Data Documentation

◆ MAX_MSG_LEN

constexpr std::size_t tcalc::error::Error::MAX_MSG_LEN = 256
staticconstexpr

Max message length.


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