Use case(s) - what problem will this feature solve?
When using a gRPC server through a reverse proxy, the client will sometimes see plaintext or HTML error served by the proxy. Currently, the user of the gRPC client just sees:
rpc error: code = Unknown desc = unexpected HTTP status code received from server: 500 (Internal Server Error); transport: received unexpected content-type "text/html"
Proposed Solution
It would be more helpful if the response body was included in the error, for example:
rpc error: code = Unknown desc = unexpected HTTP status code received from server: 500 (Internal Server Error); transport: received unexpected content-type "text/html"; response body:
<first N bytes of the response body if printable>
Although of course this requires some more code on the client side, maybe not all users want to see the response body, as especially nginx can serve massive amounts of boilerplate HTML in its errors.
@drigz as per discussion with team we currently don't have bandwidth to work on this with priority. We will keep this issue open and pick up later sometime.
Use case(s) - what problem will this feature solve?
When using a gRPC server through a reverse proxy, the client will sometimes see plaintext or HTML error served by the proxy. Currently, the user of the gRPC client just sees:
Proposed Solution
It would be more helpful if the response body was included in the error, for example:
Alternatives Considered
This could also be added to the status details, so that they can be shown like this: https://jbrandhorst.com/post/grpc-errors/#:~:text=In%20order%20to%20extract%20these%20errors%20on%20the%20other%20side
Although of course this requires some more code on the client side, maybe not all users want to see the response body, as especially nginx can serve massive amounts of boilerplate HTML in its errors.
Additional Context
https://github.com/grpc/grpc-go/issues/1924#issuecomment-469870310 commented:
But I can't find that the FR was ever filed.