pub fn default_problem_responder(
response: Response<TakoBody>,
) -> Response<TakoBody>Expand description
Default problem-formatter to be installed into
Router::error_handler and/or
Router::client_error_handler.
Behavior:
- Successful responses (1xx/2xx/3xx) pass through unchanged so callers may reuse this function as a wrapper without stripping non-error bodies.
- Error responses (4xx/5xx) that already carry an
application/jsonorapplication/problem+jsonContent-Typepass through (the handler produced its own structured error and stays authoritative). - Every other error response is rewritten into a
Problemdocument built from the status code, replacing the body and forcingContent-Type: application/problem+json.