2#ifndef _KURLYK_UTILS_CLIENT_ERROR_CATEGORY_HPP_INCLUDED
3#define _KURLYK_UTILS_CLIENT_ERROR_CATEGORY_HPP_INCLUDED
26 const char*
name() const noexcept
override {
30 std::string
message(
int ev)
const override {
33 return "Request was cancelled by the user";
35 return "Request was aborted due to handler destruction";
37 return "Client was not initialized properly";
39 return "Invalid or missing client configuration";
41 return "Operation failed: client is not connected";
43 return "Operation was rejected because the queue limit was exceeded";
45 return "Operation was rejected because the client is shutting down";
47 return "Unknown HTTP client error";
71 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.
@ ShuttingDown
Operation was rejected because the owning subsystem is shutting down.
@ NotConnected
Operation requires an active connection but none exists.
@ AbortedDuringDestruction
Request handler was destroyed before completion, causing the request to abort.
@ QueueLimitExceeded
Operation was rejected because the bounded queue is already full.
@ 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.