|
Air-Trap 1.0.0
A multiplayer R-Type clone game engine built with C++23 and ECS architecture
|
Comprehensive error object with severity and retry tracking. More...
#include <Error.hpp>
Public Member Functions | |
| ErrorCode | code (void) const noexcept |
| Get the error code. | |
| log::Level | severity (void) const noexcept |
| Get the severity level of this error. | |
| std::uint8_t | retryCount (void) const noexcept |
| Get the current retry count. | |
| auto | message (void) const noexcept -> std::string_view |
| Get the error message. | |
| std::uint8_t | incrementRetryCount (void) noexcept |
| Increment the retry counter. | |
Static Public Member Functions | |
| template<typename ... Args> | |
| static auto | failure (ErrorCode code, std::format_string< Args... > fmt, Args &&...args) -> Error |
| Create a failure-level error. | |
| template<typename ... Args> | |
| static auto | warning (ErrorCode code, std::format_string< Args... > fmt, Args &&...args) -> Error |
| Create a warning-level error. | |
| template<typename ... Args> | |
| static auto | fatal (ErrorCode code, std::format_string< Args... > fmt, Args &&...args) -> Error |
| Create a fatal-level error. | |
Private Member Functions | |
| Error (ErrorCode code, log::Level severity, std::string_view msg) | |
| Private constructor for error creation. | |
Private Attributes | |
| ErrorCode | _code |
| The error code. | |
| log::Level | _severity |
| Severity level of the error. | |
| std::uint8_t | _retryCount {0} |
| Number of retry attempts. | |
| std::string | _message |
| Formatted error message. | |
Comprehensive error object with severity and retry tracking.
The Error class provides a rich error representation that includes:
Factory methods are provided to create errors with different severity levels.
|
private |
|
noexcept |
Get the error code.
Definition at line 85 of file Error.cpp.
Referenced by std::formatter< rtp::Error >::format().
|
static |
Create a failure-level error.
| Args | Format argument types |
| code | The error code |
| fmt | Format string |
| args | Format arguments |
Referenced by rtp::sys::impl::LibraryBackend::close(), rtp::log::configure(), rtp::thread::ThreadPool::create(), rtp::sys::LibraryManager::getOrLoadInternal(), rtp::sys::impl::LibraryBackend::getSymbol(), rtp::sys::LibraryManager::loadStandalone(), rtp::sys::impl::LibraryBackend::open(), and rtp::ecs::Registry::spawn().
|
static |
Create a fatal-level error.
| Args | Format argument types |
| code | The error code |
| fmt | Format string |
| args | Format arguments |
|
noexcept |
|
noexcept |
Get the error message.
Definition at line 100 of file Error.cpp.
Referenced by std::formatter< rtp::Error >::format().
|
noexcept |
|
noexcept |
Get the severity level of this error.
Definition at line 90 of file Error.cpp.
Referenced by std::formatter< rtp::Error >::format().
|
static |
Create a warning-level error.
| Args | Format argument types |
| code | The error code |
| fmt | Format string |
| args | Format arguments |
|
private |
|
private |
|
private |