Skip to main content

Module error

Module error 

Source
Expand description

JSON:API error objects and their mapping onto HTTP status codes.

Every error a handler returns is one of these: a code, the HTTP status it maps to, and a pointer at whatever caused it. Internal errors are sanitized — the detail is dropped and only the correlation id survives, so a connection string in a data-layer error cannot reach a client.

Structs§

JsonApiError
An error on its way to becoming a JSON:API error object.
StatusCode
An HTTP status code (status-code in RFC 9110 et al.).

Enums§

ErrorCode
The JSON:API code values this crate emits, and the HTTP status each carries.

Constants§

INTERNAL_DETAIL
The detail text sent in place of a sanitized internal error message.