Skip to content
This repository has been archived by the owner on Apr 16, 2020. It is now read-only.

Is there a way to add error details in Status? #136

Open
pepsighan opened this issue Mar 10, 2019 · 3 comments
Open

Is there a way to add error details in Status? #136

pepsighan opened this issue Mar 10, 2019 · 3 comments

Comments

@pepsighan
Copy link

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.

@per-gron
Copy link
Collaborator

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.

@pepsighan
Copy link
Author

@per-gron There is a field details in Status but no way to modify that.

@seanmonstar
Copy link
Contributor

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants