connect-go icon indicating copy to clipboard operation
connect-go copied to clipboard

Provide function to write RPC errors from HTTP middleware

Open akshayjshah opened this issue 3 years ago • 1 comments
trafficstars

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 avatar Jul 28 '22 14:07 akshayjshah

I look forward to this feature coming soon

anhnmt avatar Aug 02 '22 02:08 anhnmt

Released in v0.5.0!

akshayjshah avatar Sep 23 '22 17:09 akshayjshah