Skip to main content

error_body

Function error_body 

Source
pub fn error_body(status: &Status, details: Option<&StatusDetails>) -> Value
Expand description

The JSON error body for a failed call, shared by the unary response and the terminal frame of a stream so a client parses one shape everywhere.

error is the gRPC code name, code its number and message the status message. With details, the body also carries details: the upstream’s google.rpc.Status.details in proto3 JSON form (empty when the upstream sent none), plus opaqueDetails for details whose type no descriptor describes when the renderer forwards them (StatusDetails::with_opaque_details); without it, both keys are absent and the trailer is not read. When the details cannot be rendered faithfully the whole body is a generic INTERNAL instead, never a partial or reinterpreted set of details.