Air-Trap 1.0.0
A multiplayer R-Type clone game engine built with C++23 and ECS architecture
Loading...
Searching...
No Matches
Error.hpp File Reference

Error handling system with categorized error codes. More...

#include "RType/LogLevel.hpp"
#include <cstdint>
#include <format>
#include <string>
#include <string_view>
#include <system_error>
#include <utility>
#include "Error.inl"
#include "Error.tpp"
Include dependency graph for Error.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  std::is_error_code_enum< rtp::ErrorCode >
 Specialization to enable ErrorCode as a valid error code enum. More...
 
struct  std::formatter< rtp::ErrorCode >
 
class  rtp::Error
 Comprehensive error object with severity and retry tracking. More...
 
struct  std::formatter< rtp::Error >
 Formatter specialization for Error objects. More...
 

Namespaces

namespace  rtp
 
namespace  std
 STL namespace.
 

Enumerations

enum class  rtp::ErrorCode : std::uint16_t {
  rtp::Success = 0 , rtp::Unknown = 1 , rtp::InvalidParameter , rtp::InternalRuntimeError ,
  rtp::ConnectionFailed = 100 , rtp::Disconnected , rtp::Timeout , rtp::PayloadError ,
  rtp::FileNotFound = 200 , rtp::LibraryLoadFailed , rtp::SymbolNotFound , rtp::InvalidFormat ,
  rtp::ComponentMissing = 300 , rtp::RegistryFull , rtp::EntityInvalid
}
 Enumeration of all possible error codes in the RType engine. More...
 

Functions

constexpr std::string_view rtp::toString (ErrorCode e) noexcept
 Convert an ErrorCode to its string representation.
 
std::error_code rtp::make_error_code (ErrorCode e) noexcept
 Create a std::error_code from an ErrorCode.
 
const std::error_category & rtp::rtype_category (void) noexcept
 Get the RType error category for std::error_code integration.
 

Detailed Description

Error handling system with categorized error codes.

Author
Robin Toillon

Provides a comprehensive error handling framework with:

  • Categorized error codes (Core, Network, IO, ECS)
  • Integration with std::error_code
  • Severity levels (warning, failure, fatal)
  • Formatted error messages
  • Retry counting mechanism

Definition in file Error.hpp.