-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
With v2 we should be able to detect real NotFound responses from gRPC service NotFound responses #1513
Comments
This sounds like a good idea, I did wrestle with the issue of how to represent nonexistent URIs in the new error handling, and I think it makes sense to split it out of the existing handling altogether. Another thing that v1 did is differentiate between ErrUnknownURI and ErrMethodNotAllowed (e.g. sending GET to a POST endpoint). We might want to weave that into this new handler too, maybe we should make it more generic, how about CC @jhump who I know had some comments on the new error handling in v2 as well. |
@johanbrandhorst Right, WithHTTPErrorHandler should be event better and cleaner way to handle pre-gRPC errors! |
Sounds good, what can I do to help you contribute this change? I would start looking at how the existing error handler is defined and used which should be easy enough to adapt to this new handler. We'll also need to update the v2 migration guide, which already has a section on error handling. |
I believe I can come up with PR in a few days and evaluate it on our codebase to see how it may fit. |
Fixed with #1517 |
🚀 Feature
With new unified error handler in v2 it is now not possible to detect if grpc-gateway has no uri registered or gRPC method returned real NotFound.
Proposal:
Add option grpcgwruntime.WithNotFoundHandler(errorHandler) so user can handle code correctly.
Current Behaviour is misleading and can cause issues:
The text was updated successfully, but these errors were encountered: