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§
- Error
Body - The JSON body of every non-2xx response:
{"error": "<message>"}.pub/ToSchemaso 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 ofcontent?: 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 theFromimpls below), the same “one error enum, converted at the boundary” shapebhtune-cli’s commands use withanyhow::Result.