Skip to main content

error_response

Function error_response 

Source
pub fn error_response(status: StatusCode, code: &str, message: &str) -> Response
Expand description

Render a refusal as JSON with a machine-readable code.

The code matters more than the prose: a consumer decides whether to retry, re-authorise, or give up by reading it.