pub struct ErrorDetail {
pub type_url: String,
pub value: Option<String>,
pub debug: Option<Value>,
}Expand description
Additional error details that can be attached to a ConnectRPC error.
Fields§
§type_url: StringThe type URL for this detail.
Named type per Connect protocol (distinct from protobuf JSON @type).
value: Option<String>Base64-encoded protobuf message.
debug: Option<Value>Debug information (JSON representation).
Implementations§
Source§impl ErrorDetail
impl ErrorDetail
Sourcepub fn from_message(
type_name: impl Into<String>,
message: &impl Message,
) -> Self
pub fn from_message( type_name: impl Into<String>, message: &impl Message, ) -> Self
Build a detail from a protobuf message, handling the base64 encoding the Connect protocol requires.
type_name is the message’s bare fully-qualified name — e.g.
google.rpc.RetryInfo — which is what the Connect protocol’s JSON
type field carries; the gRPC path prepends the standard
type.googleapis.com/ Any prefix automatically (a value already
carrying a prefix is passed through unchanged on that path). The
message is encoded to protobuf wire bytes and base64’d with the
protocol’s canonical unpadded-standard alphabet — prefer this over
populating value by hand, where a wrong alphabet is
dropped from the gRPC status (with a logged warning).