2#ifndef _KURLYK_UTILS_CLIENT_ERROR_CATEGORY_HPP_INCLUDED
3#define _KURLYK_UTILS_CLIENT_ERROR_CATEGORY_HPP_INCLUDED
24 const char*
name() const noexcept
override {
28 std::string
message(
int ev)
const override {
31 return "Request was cancelled by the user";
33 return "Request was aborted due to handler destruction";
35 return "Client was not initialized properly";
37 return "Invalid or missing client configuration";
39 return "Operation failed: client is not connected";
41 return "Unknown HTTP client error";
65 struct is_error_code_enum<
kurlyk::utils::ClientError> : true_type {};
Custom std::error_category for reporting internal client errors not tied to specific protocols (e....
const char * name() const noexcept override
std::string message(int ev) const override
ClientError
Defines errors related to the internal state or lifecycle of the HTTP/WebSocket client.
@ NotConnected
Operation requires an active connection but none exists.
@ AbortedDuringDestruction
Request handler was destroyed before completion, causing the request to abort.
@ ClientNotInitialized
Operation attempted before client was properly initialized.
@ CancelledByUser
Request was cancelled explicitly by the user via cancel().
@ InvalidConfiguration
Provided configuration is incomplete or invalid.
const std::error_category & client_error_category()
Returns the singleton instance of the ClientErrorCategory.
std::error_code make_error_code(ClientError e)
Creates a std::error_code from a ClientError value.
Primary namespace for the Kurlyk library, encompassing initialization, request management,...
Enables use of ClientError with std::error_code.