24#ifndef LIBHELPER_ERROR_HPP
25#define LIBHELPER_ERROR_HPP
74 Error(
const Error &other) noexcept : message(other.message) {}
78 oss << std::format(fmt, std::forward<Args>(args)...);
86 return std::move(*
this);
99 return std::move(*
this);
106 [[nodiscard]]
const char *
what() const noexcept
override {
return message.
data(); }
A modern, throwable error class. It provides the << operator and offers usage in the std::print style...
Definition error.hpp:65
Error && withCode(int _ec)
It is used to determine the error code when an error is thrown.
Definition error.hpp:97
int getErrorCode() const
Get error code.
Definition error.hpp:103
Error(const Error &other) noexcept
Copy constructor.
Definition error.hpp:74
Error(std::format_string< Args... > fmt, Args &&...args)
Modern std::print style input field constructor.
Definition error.hpp:77
Error && operator<<(const T &msg) &&
To use the << operator for receiving non-function-like inputs.
Definition error.hpp:83
const char * what() const noexcept override
Get error message.
Definition error.hpp:106
Error & operator<<(std::ostream &(*msg)(std::ostream &))
To receive function-like inputs, use the << operator.
Definition error.hpp:90
A logging solution that can be used throughout the program(s).
Main namespace of libhelper library.
Definition capsule.hpp:27