esp-v2: Support modifying gRPC application errors
Hej, When using cloud endpoints espV2 using Proto Descriptors with HTTP annotations it is unclear on if we can return a custom error json body for HTTP Clients.
Using the google.rpc.Status proto allows us to conform to best practices going forward but when we need to build http endpoints that need to conform to a specific Error Schema for services outside of our control it limits our ability to move towards a pure grpc implementation for our backend services while also being able to serve our http clients.
ex. { "errors" : [ "field" : "string", "code": "string", "message" : "string"],[ "field" : "string", "code": "string", "message" : "string"] ]}
I found this issue
that seems to be addressed in
which seems allow the serving of custom error responses however I have not found any documentation describing if this is possible to do in EspV2.
I’m hopeful the capability exists and if so if you could please point me to an example it would be greatly appreciated.
If the capability does not exist if you could enable it in some way maybe by a custom metadata trailer bin / header where we could encode the proper error json response for http clients while setting the correct http response code that would be amazing.
The implementation that I am using today is using ESPv2 as a sidecar within K8s and it has been working perfectly however the need to support customer error messages for http clients is very high.
Thank for the great functionality EspV2 brings to the table!
About this issue
- Original URL
- State: open
- Created 3 years ago
- Comments: 16 (11 by maintainers)
I see. You want the field name to be “errors” instead of “details” in the error response body. Thanks.
We need to confirm if LocalReplyConfig works with requests handled by the upstream backend. If it works, it will serve your need.