idfxx 1.0.0
Modern C++23 components for ESP-IDF
Loading...
Searching...
No Matches
idfxx::net::error_category Class Reference

Error category for idfxx_net errors. More...

Inheritance diagram for idfxx::net::error_category:

Public Member Functions

const charname () const noexcept override final
 Returns the name of the error category.
 
std::string message (int ec) const override final
 Returns a human-readable message for the given error code.
 
std::error_condition default_error_condition (int code) const noexcept override final
 Maps an errc value to its canonical portable condition.
 

Detailed Description

Error category for idfxx_net errors.

Returns human-readable names for errc values and maps each code to its standard std::errc synonym via default_error_condition().

Definition at line 106 of file error.hpp.

Member Function Documentation

◆ default_error_condition()

std::error_condition idfxx::net::error_category::default_error_condition ( int  code) const
finaloverridenoexcept

Maps an errc value to its canonical portable condition.

Returns the equivalent std::errc condition for codes that have a POSIX synonym (e.g. operation_would_block, connection_reset); codes without one (DNS failures, netconn_closed, …) map to a condition in this category. Because the runtime drives ==/!= comparisons between an std::error_code and an std::error_condition through this mapping, callers may compare against either form:

ec == std::errc::operation_would_block
std::expected< T, std::error_code > result
result type wrapping a value or error code.
Definition error.hpp:120

The mapping is symmetric, so two codes that share a synonym (connection_reset and netconn_reset) compare equal to the same std::errc and to each other's condition.

Parameters
codeThe errc value to canonicalize.
Returns
The canonical std::error_condition for code.

◆ message()

std::string idfxx::net::error_category::message ( int  ec) const
finaloverride

Returns a human-readable message for the given error code.

◆ name()

const char * idfxx::net::error_category::name ( ) const
finaloverridenoexcept

Returns the name of the error category.


The documentation for this class was generated from the following file: