Error#
A flexible error result type.
Info
To use declarations from this page, include the <essence/error.hpp> header.
-
class error#
A flexible error type, great for use with std::expected.
-
template<typename ...Args>
error::error(i32 n, std::string_view msg, Args&&... args)# Constructor using std::format arguments.
-
std::string message() const#
Get a copy of the error message string.
-
template<typename ...Args>
error &message(std::string_view msg, Args&&... args)# Setter for the error message, with std::format arguments.
-
void die() const noexcept#
Prints the error message and terminates, marked with the
[[noreturn]]attribute.
-
constexpr operator bool() const noexcept#
Implicit boolean conversion; evaluates to true only when the error number is
-5, which is the default value.
-
template<typename ...Args>