Skip to content

Improving API Core gRPC error reporting #150

Open
@crwilcox

Description

@crwilcox

While looking into googleapis/python-firestore#4 it seems gRPC reports child error details. While this is helpful, it can be a bit misleading to a user, as it will pair things like 503 (unavailable) with the text 'deadline exceeded' (error code 504) which seems strange.

I reached out to @lidizheng to discuss this and they brought up using debug_error_string: https://github.com/grpc/grpc/blob/d3e97d953b9a94d017d76a44b780bb5ca48e5840/src/python/grpcio/grpc/_channel.py#L80

We could potentially add rpc_exc.debug_error_string() to the exceptions formed at from_grpc_error:

rpc_exc.code(), rpc_exc.details(), errors=(rpc_exc,), response=rpc_exc

Note: this could be verbose. An example raised:

{"created":"@1615494939.757345505","description":"xds call failed","file":"src/core/ext/xds/xds_client.cc","file_line":1260}
E0311 20:35:39.757768839  443158 xds_cluster_resolver.cc:742] [xds_cluster_resolver_lb 0x7ffb5c005550] discovery mechanism 0 xds watcher reported error: {"created":"@1615494939.757345505","description":"xds call failed","file":"src/core/ext/xds/xds_client.cc","file_line":1260}

Though in the case of the bug raised the error would look more like "receiving error from server, which is "Deadline Exceeded"."

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions