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

Check cause chain of exceptions when handling redirects #13487

Open
jchadwick-buf opened this issue Feb 21, 2025 · 0 comments
Open

Check cause chain of exceptions when handling redirects #13487

jchadwick-buf opened this issue Feb 21, 2025 · 0 comments

Comments

@jchadwick-buf
Copy link

jchadwick-buf commented Feb 21, 2025

Describe the problem

Right now, the Connect ES library wraps exceptions thrown inside of calls (including interceptors written by users) into ConnectError, with the original error thrown placed into the cause field. Because of this, when you do a redirect call inside of a connect-es interceptor, it doesn't work as expected.

Describe the proposed solution

Since the cause field is now widely supported, it would be very nice if code that checks for Redirect exceptions could also check the chain of causes.

Alternatives considered

  • An easy-but-cumbersome work-around is to wrap each call to a Connect ES client with a try/catch handler, detect a redirect in the cause and re-throw that. This works today, but it has to be done manually at each RPC call-site, so it is far from ideal.
  • Connect ES could be changed to not wrap errors thrown in interceptors, or make this behavior configurable. However, the sentiment for this change seems to be poor a few different reasons.

Importance

would make my life easier

Additional Information

No response

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

No branches or pull requests

1 participant