Client-side support for trailing metadata in GRPCError?
alvin-trusttoken opened this issue · 3 comments
Do you currently support getting the metadata for Error responses, on the client-side? I noticed that the GPRCError
class (https://github.com/vmagamedov/grpclib/blob/master/grpclib/exceptions.py#L6) only includes the status code and message.
What I am interested is the richer GRPC status model, described in https://www.grpc.io/docs/guides/error/ and https://grpc.github.io/grpc/python/grpc_status.html#. Basically, custom protobufs can be stored in the trailing metadata, to provide more context about errors.
I've already implemented this on the Server side (which for me is written in standard grpcio python), and can also read it with grpcio Python client. Would like to see if I can read the metadata in grpclib as well.
Great library by the way!
You currently can read trailing metadata, but this metadata is incomplete, unfortunately. I'm going to fix this soon.
Implemented status details support in grpclib==0.3.1rc1
, here is how to use this feature: https://grpclib.readthedocs.io/en/latest/errors.html#error-details
Please let me know if this implementation needs some further improvements.
this looks great! even easier to use than the grpcio-version. will test it out soon. thank you!