Additional fields contributed by a subclass, such as httpStatus on HttpError.
Typed unknown, so a key that is not declared above has to be narrowed before it is used.
OptionalcauseMessage of the error that caused this one, truncated to 256 characters.
Present only when originalError is an Error and its
message differs from message. A cause that is not an Error is
never serialized, so an arbitrary object carrying credentials cannot end up in the payload.
OptionalcodeStable machine-readable code for the failure — the error's kind.
Human-readable description of the failure — the error's message.
The JSON-safe payload toJson() produces, for logs and error reports.
Only the fields the SDK deliberately exposes are present, so the payload can be forwarded to a logging service as it is. Subclasses add their own keys: HttpError adds
codeandhttpStatusand, when the failing call is known,endpointandmethod; NetworkError addsendpoint,method,durationMs,onlineandvisibility.Example: An HttpError from a request that was refused