-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Allow status.FromContextError to work with wrapped errors #4976
Copy link
Copy link
Closed
Labels
Type: FeatureNew features or improvements in behaviorNew features or improvements in behavior
Description
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type: FeatureNew features or improvements in behaviorNew features or improvements in behavior