Allow overriding the default gRPC status to HTTP status rules for an unframed gRPC response
See original GitHub issueAn unframed gRPC service statically maps gRPC status to HTTP status based on https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto. I got a question from Armera slack channel. https://line-armeria.slack.com/archives/C1NGPBUH2/p1625735446194500
How can I map StatusRuntimeException to http status codes?
Unfortunately, the answer is no. We don’t provide a way to customize the default mapping rules at the moment.
It would be nice to take a custom mapping function using GrpcServiceBuilder.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Customizing your gateway | gRPC-Gateway - GitHub Pages
To have the most control over the HTTP response status codes, you can use custom metadata. While handling the rpc, set the intended...
Read more >HTTP to gRPC Status Code Mapping
This table is to be used only for clients that received a response that did not include grpc-status. If grpc-status was provided, it...
Read more >Job failed - consul connect - Nomad - HashiCorp Discuss
Parameters in the main config file override values in the default file. Do not remove "config.default" parameter from this file unless you ...
Read more >Browsing and invoking services with DocService
of(new MyThriftHelloService())); // Add a gRPC service which implements 'GrpcHelloService'. // Unlike Thrift, you must enable unframed requests explicitly. sb.
Read more >Emulator release notes - Android Developers
Updated foldable AVD design and default settings; Updated Wear emulator buttons; gRPC audio streaming improvements; Resizable emulator ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Ah, sorry for the misunderstanding the meaning of
UnstableApi; I checked a description aboutUnstableApi.So you said I could add the breaking change simply. Thank you for answer 🙇
We can introduce an interface to let users override the mapping from gRPC status to HTTP status for unframed gRPC requests.
The
UnframedGrpcStatusFunctionset viaGrpcServiceBuildercould be used inUnframedGrpcErrorHandlerwith a breaking change. AsUnframedGrpcErrorHandleris an unstable API, we can addUnframedGrpcStatusFunctionas the 4th parameter. https://github.com/line/armeria/blob/ef93d4cbe1657c339875b1dbc970b2f8ef848087/grpc/src/main/java/com/linecorp/armeria/server/grpc/UnframedGrpcErrorHandler.java#L111