StormByte 2.0.0
C++26 foundation of the StormByte suite
 
Loading...
Searching...
No Matches
StormByte::Error Namespace Reference

Error-code domains and the StormByte::Error::Fault value type. More...

Classes

class  Category
 std::error_category backed by StormByte::Error::Domain. More...
 
struct  Domain
 Description of one error-code enum. More...
 
struct  Domain< Code >
 Domain for StormByte::Error::Code. More...
 
class  Fault
 Held error: an std::error_code and a StormByte::Safe::String message. More...
 

Concepts

concept  Described
 Enum that has a StormByte::Error::Domain specialization.
 

Enumerations

enum class  Code { Success = 0 , Unknown }
 Suite-level codes that are not module-specific. More...
 

Functions

const Category< Code > & category () noexcept
 Process-wide category for StormByte::Error::Code.
 
std::error_code make_error_code (Code e) noexcept
 Builds an std::error_code from StormByte::Error::Code.
 

Detailed Description

Error-code domains and the StormByte::Error::Fault value type.

Modules specialize StormByte::Error::Domain for their enums. The category singleton for each enum lives in that module's .cxx. StormByte::Exception is unrelated: throw / Expected stay there.

Enumeration Type Documentation

◆ Code

enum class StormByte::Error::Code
strong

Suite-level codes that are not module-specific.

Enumerator
Success 

No error.

Unknown 

Unclassified suite error.

Function Documentation

◆ category()

const Category< Code > & StormByte::Error::category ( )
noexcept

Process-wide category for StormByte::Error::Code.

Returns
Category singleton (defined in error.cxx).

◆ make_error_code()

std::error_code StormByte::Error::make_error_code ( Code  e)
noexcept

Builds an std::error_code from StormByte::Error::Code.

Parameters
eSuite enumerator.
Returns
Code in the suite category.

Lives in this namespace so ADL finds it for std::error_code{Code}.