class RequestStatusExtended(RequestStatus): (source)
Constructor: RequestStatusExtended.from_rpc_status(status, request_id, trace_id, registry)
Extended request status that includes parsed service errors.
This supplements RequestStatus with a list of domain-specific
ServiceError messages extracted from the status details.
| Class Method | from |
Construct an extended status by extracting ServiceError protos. |
| Method | __str__ |
Render a compact human-readable representation of the status. |
| Method | is |
Return True when the status is considered retriable. |
| Method | to |
Convert this extended status back into a protobuf Status. |
| Instance Variable | code |
gRPC status code |
| Instance Variable | details |
list of google.protobuf.Any detail messages |
| Instance Variable | message |
human readable message (may be None) |
| Instance Variable | request |
request identifier extracted from metadata |
| Instance Variable | service |
list of parsed ServiceError messages |
| Instance Variable | trace |
trace identifier extracted from metadata |
| Method | _extended |
Undocumented |
| Class Variable | _original |
Undocumented |
Inherited from RequestStatus:
| Class Variable | registry |
Undocumented |
| Method | _localized |
Undocumented |
| Method | _state |
Undocumented |
| Class Variable | _original |
Undocumented |
| Class Variable | _raw |
Undocumented |
def from_rpc_status(cls, status:
object, request_id: str, trace_id: str, *, registry: Registry | None = None) -> RequestStatusExtended:
(source)
¶
Construct an extended status by extracting ServiceError protos.
This function uses internal helper pb2_from_status to remove
service error protos from the details and returns them as
ServiceError messages.
Render a compact human-readable representation of the status.
This is used when building exception messages for RequestError.
Return True when the status is considered retriable.
Retriability is determined by inspecting service-level retry hints and a set of default gRPC status codes. When deadline_retriable is True the DEADLINE_EXCEEDED code is considered retriable.
Convert this extended status back into a protobuf Status.
Service errors are packed into Any messages and included in the returned Status details.