Skip to main content

Module error

Module error 

Source
Expand description

ApiError: the one error type every route handler returns, and its mapping onto an HTTP status code plus a JSON {"error": "..."} body.

Structs§

ErrorBody
The JSON body of every non-2xx response: {"error": "<message>"}. pub/ToSchema so every fallible #[utoipa::path] response can reference it (body = ErrorBody) and the generated OpenAPI spec – and therefore the generated frontend TS client – accurately types error bodies instead of content?: never.

Enums§

ApiError
Every way a request can fail, already carrying the HTTP status it maps to – handlers return Result<_, ApiError> and let ? do the conversion (see the From impls below), the same “one error enum, converted at the boundary” shape bhtune-cli’s commands use with anyhow::Result.