connect-go
connect-go copied to clipboard
add HTTP error helper
The mapping from connect error codes to HTTP status codes is currently private and not accessible to users who are implementing connect in their existing HTTP servers. This helper has been added to allow those users to easily update existing HTTP middlewares to handle connect errors.
fixes #331
Awesome, I'm glad you've got some bandwidth to take this on @rhbuf! This is a great start.
Unfortunately, this function only returns valid responses for unary requests using the Connect protocol. If we're going to ship this, we shouldn't make users figure out the protocol in use, the compression scheme, etc - I think we should respond appropriately to unary Connect, streaming Connect, gRPC, and gRPC-Web requests, so that RPC clients get full-fidelity error codes, messages, and details. Doing that requires access to the request headers.
Awesome, I'm glad you've got some bandwidth to take this on @rhbuf! This is a great start.
Unfortunately, this function only returns valid responses for unary requests using the Connect protocol. If we're going to ship this, we shouldn't make users figure out the protocol in use, the compression scheme, etc - I think we should respond appropriately to unary Connect, streaming Connect, gRPC, and gRPC-Web requests, so that RPC clients get full-fidelity error codes, messages, and details. Doing that requires access to the request headers.
Roger that, I will come back in a week or so and flesh this out. I've switched directions in my current work and no longer needs this HTTP helper function, but I want to finish what I've started when I have some time.
I've switched directions in my current work and no longer needs this HTTP helper function, but I want to finish what I've started when I have some time.
Don't sweat it! This isn't a "you touch it, you buy it" system :) I'll try to take over and finish up; if I don't get to it and you're free, feel free to pick it up again.
@rhbuf and @pkwarren, I took a shot at finishing this up - let me know what you think!
🙏 thanks all, this is what I've been waiting for as well.