ljson::error class

a class type inspired by std::error_code to handle errors

Constructors, destructors, conversion operators

error(error_type err, const std::string& message) noexcept
constructor
template <typename... args_t>
error(error_type err, std::format_string<args_t...> fmt, args_t && ... args) noexcept
constructor

Public functions

auto message() const →  const std::string& noexcept
get the string message of the error
auto value() const →  error_type noexcept
get the ljson::error_type of the error
auto what() const →  const char* noexcept
get the string message of the error

Function documentation

ljson::error::error(error_type err, const std::string& message) noexcept

constructor

Parameters
err holds the value of ljson::error_type
message the string message of the error

template <typename... args_t>
ljson::error::error(error_type err, std::format_string<args_t...> fmt, args_t && ... args) noexcept

constructor

Template parameters
args_t the types of arguments for std::format()
Parameters
err holds the value of ljson::error_type
fmt std::format() type
args the arguments for std::format()

const std::string& ljson::error::message() const noexcept

get the string message of the error

Returns get the string message of the error

error_type ljson::error::value() const noexcept

get the ljson::error_type of the error

Returns get the ljson::error_type of the error

const char* ljson::error::what() const noexcept

get the string message of the error

Returns get the string message of the error