Skip to content

Allow status.FromContextError to work with wrapped errors #4976

Closed
@bestbeforetoday

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.

Metadata

Assignees

No one assigned

    Labels

    Type: FeatureNew features or improvements in behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions