Expand description
Error types and handling for the server.
Structs§
- Error
Response - The one error body every route answers with (#5750):
{"error", "code"},errora human-readable message andcodea stableSCREAMING_SNAKEidentifier a client can branch on.ApiErrorrenders it for every handler failure, andmiddleware::error_enveloperenders 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 indocs/guide/server.md(“Error envelope”).
Enums§
- ApiError
- API error types.
Constants§
- CACHE_
CLIENT_ 🔒MESSAGE - The
errortext of aCACHE_ERRORresponse. 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 absoluteCACHE_DIRlayout.
Functions§
- error_
response - Render the shared envelope. The one builder of an error body:
ApiErrorgoes through it, and so do the responses written outside a handler (the bearer layer’s401,middleware::error_envelope).