Module error

Module error 

Source
Expand description

Error types and handling for the server.

Structs§

ErrorResponse
The one error body every route answers with (#5750): {"error", "code"}, error a human-readable message and code a stable SCREAMING_SNAKE identifier a client can branch on. ApiError renders it for every handler failure, and middleware::error_envelope renders it for the responses no handler writes (extractor rejections, unknown routes, wrong methods, timeouts, panics), so a client decodes one shape for every non-2xx status. Documented in docs/guide/server.md (“Error envelope”).

Enums§

ApiError
API error types.

Constants§

CACHE_CLIENT_MESSAGE 🔒
The error text of a CACHE_ERROR response. The underlying detail stays in the server log: cacache’s error text names the index bucket or content file it failed on, which is the absolute CACHE_DIR layout.

Functions§

error_response
Render the shared envelope. The one builder of an error body: ApiError goes through it, and so do the responses written outside a handler (the bearer layer’s 401, middleware::error_envelope).