Skip to main content

handle_error

Function handle_error 

Source
pub fn handle_error(status: Status) -> Response<BoxBody>
Expand description

Converts a gRPC status into an HTTP response.

This helper creates a JSON response body containing the error code and message, falling back to standard HTTP status codes derived from the gRPC status.

§Parameters

  • status: The tonic::Status to convert.

§Returns

An http::Response containing the JSON-encoded error details.