tower-grpc
tower-grpc copied to clipboard
Is there a way to add error details in Status?
When returning an error message via Status
, we can only provide Code
and message. There is currently no method provided to add details to it as far as I know.
It would be awesome to provide additional metadata to provide the client with additional contexts of the error.
Did you see the details
field of Status
? It is for that. The convention is to put a protobuf message in it. I'm not sure if grpc offers a standard proto message type for it though.
@per-gron There is a field details
in Status
but no way to modify that.
It's true there isn't currently a way to add to the details
method. I'm not especially familiar with the grpc.Status
message type, but other grpc libraries seem to offer encoding one in the details of a Status
. That's what this field is supposedly for... We haven't figured out the right way to add them yet, it seems, but I don't really know what that would be, either.