Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow status.FromContextError to work with wrapped errors #4976

Closed
bestbeforetoday opened this issue Nov 12, 2021 · 0 comments · Fixed by #4977
Closed

Allow status.FromContextError to work with wrapped errors #4976

bestbeforetoday opened this issue Nov 12, 2021 · 0 comments · Fixed by #4977
Labels
Type: Feature New features or improvements in behavior

Comments

@bestbeforetoday
Copy link
Contributor

Use case(s) - what problem will this feature solve?

A client application using gRPC may wrap errors returned from invocations of the gRPC API to provide additional context to consuming code. If the error being wrapped and returned is a context error, it cannot be used with status.FromContextError, since the implementation checks that an error is exactly one of the sentinel values.

Proposed Solution

Re-implement status.FromContextError to use errors.Is instead of direct value equality. I think this should retain compatibility with existing behaviour while extending support for wrapped errors.

Alternatives Considered

None.

Additional Context

N/A.

@bestbeforetoday bestbeforetoday added the Type: Feature New features or improvements in behavior label Nov 12, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Type: Feature New features or improvements in behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant