51 class RTypeCategory :
public std::error_category {
53 const char *name(
void)
const noexcept override
58 std::string message(
int ev)
const override
66 : _code(code), _severity(severity), _message(msg)
76 static const RTypeCategory instance;
92 return this->_severity;
97 return this->_retryCount;
103 return this->_message;
108 return this->_retryCount++;
Error handling system with categorized error codes.
Error(ErrorCode code, log::Level severity, std::string_view msg)
Private constructor for error creation.
std::uint8_t retryCount(void) const noexcept
Get the current retry count.
log::Level severity(void) const noexcept
Get the severity level of this error.
auto message(void) const noexcept -> std::string_view
Get the error message.
ErrorCode code(void) const noexcept
Get the error code.
std::uint8_t incrementRetryCount(void) noexcept
Increment the retry counter.
Level
Severity levels for log messages.
ErrorCode
Enumeration of all possible error codes in the RType engine.
std::error_code make_error_code(ErrorCode e) noexcept
Create a std::error_code from an ErrorCode.
const std::error_category & rtype_category(void) noexcept
Get the RType error category for std::error_code integration.
constexpr std::string_view toString(ErrorCode e) noexcept
Convert an ErrorCode to its string representation.