Skip to main content

errors_as_json

Function errors_as_json 

Source
pub async fn errors_as_json(request: Request, next: Next) -> Response
Expand description

Turns error responses that are not JSON yet, like the rejections of axum’s extractors, into the error format of all Kellnr endpoints. Their text becomes the detail; other headers are kept. A PlainTextError stays as it is.