Return JSON on error when using gRPC-gateway

Hi, I’m using the Kong gRPC-Gateway and I would like to return a JSON body on errors. I’m getting the error code passed to the client, and the error details are in the “grpc-status”, “grpc-message” and “grpc-status-details-bin” response headers, but it would be most convenient for the client to have the details in the response body in JSON format.
I suppose I could write a plugin to format the data from the headers to JSON, but I’m wondering if there is something I could do on the gRPC server side to return a JSON body while still having the HTTP error code set, so it doesn’t look like a regular response. Thanks for any suggestions.