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

Provide function to write RPC errors from HTTP middleware #331

Closed
akshayjshah opened this issue Jul 28, 2022 · 2 comments · Fixed by #337
Closed

Provide function to write RPC errors from HTTP middleware #331

akshayjshah opened this issue Jul 28, 2022 · 2 comments · Fixed by #337
Labels
enhancement New feature or request

Comments

@akshayjshah
Copy link
Member

Is your feature request related to a problem? Please describe.
Even though Connect handlers work with net/http middleware, it's often necessary to re-implement existing HTTP middleware as Connect interceptors so that clients get nicely-annotated errors. This is a little silly.

Describe the solution you'd like
It'd be nice for Connect to include a function that HTTP middleware can use to encode Connect errors. func WriteError(http.ResponseWriter, *http.Request, error) might work.

Describe alternatives you've considered
The status quo is okay, but forces users to jump through more hoops that we'd like.

@akshayjshah akshayjshah added the enhancement New feature or request label Jul 28, 2022
@anhnmt
Copy link

anhnmt commented Aug 2, 2022

I look forward to this feature coming soon

@akshayjshah
Copy link
Member Author

Released in v0.5.0!

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

Successfully merging a pull request may close this issue.

2 participants