pub struct ErrorBody {
pub message: String,
pub raw: Option<Value>,
}Expand description
A parsed Tango API error body. Carried on the API-error variants so callers can introspect the server’s structured error response without re-parsing.
The Tango API surfaces error bodies in a handful of shapes:
{"detail": "..."}(DRF envelope){"message": "..."}or{"error": "..."}(generic envelope){"<field>": ["..."]}(DRF field-error array)
The raw decoded JSON is preserved in ErrorBody::raw for callers that
need to inspect a custom shape. ErrorBody::message is the SDK’s best
guess at a human-readable line — extracted by walking envelope keys
(detail / message / error) first, then sorted-key iteration over the
remaining keys.
Fields§
§message: StringThe human-readable message the SDK extracted from the body, when one was available. Empty when the body had no obvious message slot.
raw: Option<Value>The raw decoded JSON value as a string (re-serialized to be stable).
None when the response had no body or the body was not JSON.