6#include <cosmos/error/ResolveError.hxx>
7#include <cosmos/error/errno.hxx>
8#include <cosmos/utils.hxx>
17 default:
return "EAI_???";
18 case Code::ADDR_FAMILY:
return "EAI_ADDRFAMILY";
19 case Code::AGAIN:
return "EAI_AGAIN";
20 case Code::BAD_FLAGS:
return "EAI_BADFLAGS";
21 case Code::FAIL:
return "EAI_FAIL";
22 case Code::FAMILY:
return "EAI_FAMILY";
23 case Code::MEMORY:
return "EAI_MEMORY";
24 case Code::NO_DATA:
return "EAI_NODATA";
25 case Code::NO_NAME:
return "EAI_NONAME";
26 case Code::SERVICE:
return "EAI_SERVICE";
27 case Code::SOCKTYPE:
return "EAI_SOCKTYPE";
28 case Code::SYSTEM:
return "EAI_SYSTEM";
29 case Code::OVERFLOW:
return "EAI_OVERFLOW";
44 return gai_strerror(to_integral(
code));
Base class for libcosmos exceptions.
std::string m_msg
Runtime generated error message.
ResolveError(const Code code)
Create a ResolveError for the given error code.
Errno m_system_errno
If m_eai_code == Code::EAI_SYSTEM this contains the system error.
Code m_eai_code
The plain resolve error code.
Code
Possible resolve error codes that can be stored in ResolveError.
@ SYSTEM
Other system error, check Errno from systemError().
void generateMsg() const override
Append type specific error information to m_msg.
std::string_view msg() const
Returns the plain resolver error message.
Code code() const
Returns the plain resolve error code stored in the exception.
Errno
Strong enum type representing errno error constants.
Errno get_errno()
Wrapper that returns the Errno strongly typed representation of the current errno