Skip to content

Conversation

glbrntt
Copy link
Collaborator

@glbrntt glbrntt commented Mar 18, 2025

Motivation:

gRPC checks whether errors thrown from interceptors are RPCError and otherwise treats them as unknown (to avoid leaking internal information). There is a third possibility: the error is explicitly marked as being convertible to an RPCError. This check is currently missing when thrown from client/server interceptors.

Modifications:

  • Catch RPCErrorConvertible in the client/server executors when thrown from interceptors
  • Add tests

Result:

Error information isn't dropped

Motivation:

gRPC checks whether errors thrown from interceptors are `RPCError` and
otherwise treats them as `unknown` (to avoid leaking internal
information). There is a third possibility: the error is explicitly
marked as being convertible to an `RPCError`. This check is currently
missing when thrown from client/server interceptors.

Modifications:

- Catch `RPCErrorConvertible` in the client/server executors when thrown
  from interceptors
- Add tests

Result:

Error information isn't dropped
@glbrntt glbrntt requested a review from gjcairo March 18, 2025 09:34
@glbrntt glbrntt added the 🔨 semver/patch No public API change. label Mar 18, 2025
@glbrntt glbrntt merged commit c4d6281 into grpc:main Mar 18, 2025
32 checks passed
@glbrntt glbrntt deleted the v2/error-convertible branch March 18, 2025 10:34
@rnro rnro mentioned this pull request Sep 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants