KEEL 1.0.0
Minimal C11 HTTP client/server library built on epoll/kqueue/io_uring/poll
Loading...
Searching...
No Matches
Enumerations | Functions
error.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  KlError {
  KL_ERR_NONE = 0 , KL_ERR_INVALID_ARG , KL_ERR_ALLOC , KL_ERR_OVERFLOW ,
  KL_ERR_SOCKET , KL_ERR_BIND , KL_ERR_LISTEN , KL_ERR_CONNECT ,
  KL_ERR_IO , KL_ERR_TIMEOUT , KL_ERR_DNS , KL_ERR_TLS_INIT ,
  KL_ERR_TLS_HANDSHAKE , KL_ERR_TLS_VTABLE , KL_ERR_URL , KL_ERR_PARSE ,
  KL_ERR_TOO_LARGE , KL_ERR_HEADER , KL_ERR_EVENT_INIT , KL_ERR_EVENT_ADD ,
  KL_ERR_QUEUE_FULL , KL_ERR_THREAD , KL_ERR_PIPE , KL_ERR_REDIRECT_LOOP ,
  KL_ERR_COMPRESS , KL_ERR_PROXY , KL_ERR__COUNT
}
 Diagnostic error codes for Keel public functions. More...
 

Functions

const char * kl_strerror (KlError err)
 Return a short human-readable message for an error code.
 

Enumeration Type Documentation

◆ KlError

enum KlError

Diagnostic error codes for Keel public functions.

Stored as a field on owning structs (KlServer, KlEventCtx, KlClientResponse, KlClient). Set at the point of return -1, defaults to KL_ERR_NONE (0) via existing memset initialization.

Enumerator
KL_ERR_NONE 

No error

KL_ERR_INVALID_ARG 

NULL pointer, negative count, bad params

KL_ERR_ALLOC 

Allocator returned NULL

KL_ERR_OVERFLOW 

Integer overflow guard tripped

KL_ERR_SOCKET 

socket() or fcntl() failed

KL_ERR_BIND 

bind() failed (EADDRINUSE, EACCES, etc.)

KL_ERR_LISTEN 

listen() failed

KL_ERR_CONNECT 

connect() failed or refused

KL_ERR_IO 

read/write/send/recv error

KL_ERR_TIMEOUT 

Operation timed out

KL_ERR_DNS 

getaddrinfo / resolver error

KL_ERR_TLS_INIT 

TLS factory returned NULL

KL_ERR_TLS_HANDSHAKE 

TLS handshake failed

KL_ERR_TLS_VTABLE 

TLS vtable missing required function

KL_ERR_URL 

URL parse error or scheme mismatch

KL_ERR_PARSE 

HTTP parse error

KL_ERR_TOO_LARGE 

Request/response too large

KL_ERR_HEADER 

CRLF injection or header build error

KL_ERR_EVENT_INIT 

Event loop init failed

KL_ERR_EVENT_ADD 

Event registration failed

KL_ERR_QUEUE_FULL 

Thread pool queue at capacity

KL_ERR_THREAD 

pthread_create failed

KL_ERR_PIPE 

pipe() failed

KL_ERR_REDIRECT_LOOP 

Too many redirects

KL_ERR_COMPRESS 

Compression error

KL_ERR_PROXY 

Proxy CONNECT rejected or protocol error

KL_ERR__COUNT 

Sentinel — not an error code

Function Documentation

◆ kl_strerror()

const char * kl_strerror ( KlError  err)

Return a short human-readable message for an error code.

Parameters
errError code.
Returns
Static string, never NULL. Returns "unknown error" for out-of-range.