client does not receive gRPC error
See original GitHub issueWe tried to use grpc-web with grpcwebproxy and ran into an issue that the client could not receive gPRC error.
- When server returns an error, our callback gets
{err: null, response: <empty>}
.
GatewayClientBase.prototype.rpcCall
calls the callback on stream “data” and error “status” events. However the stream error “status” event never fires because it tries to look up grpc-status
while the trailers body contains Grpc-Status
.
We found a related issue https://github.com/improbable-eng/grpc-web/issues/228.
Which component was supposed to handle this case mismatch?
- Suppose the error “status” issue is fixed. When a gRPC error happens, the client first receives
{err: null, response: <empty>}
, then{err: <error>, response: null}
. The client has to deal with the<empty>
response everywhere, unable to tell easily it was a failure other than calling its getters returningundefined
. What’s recommended pattern for a client to differentiate success vs. error?
Issue Analytics
- State:
- Created 5 years ago
- Comments:14
Top Results From Across the Web
GRPC Core: Status codes and their use in gRPC
Code Number Description
OK 0 Not an error; returned on success.
FAILED_PRECONDITION 9
OUT_OF_RANGE 11
Read more >Client could not find service in gRPC server - Stack Overflow
I have a Python client that is trying to connect to the server through localhost:8080. The gRPC code for the client and server...
Read more >gRPC Errors
A handy guide to gRPC errors ... gRPC is an amazing library, however, the documentation lacks details on error handling. The code examples...
Read more >Troubleshoot gRPC on .NET Core - Microsoft Learn
The .NET gRPC client requires the service to have a trusted certificate. The following error message is returned when calling a gRPC service ......
Read more >Connect to a Go GRPC Server running with TLS enabled ...
We are running a go-grpc server with TLS enabled. When we use the go-grpc-client it works perfectly fine with the Server. But when...
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
The improbable proxy should fix the issue of the upper-casing as it’s in violation of the spec. The grpc/grpc-web client could obviously implement a workaround but it should not be the one primarily responsible for fixing the incompatibility. I remain optimistic that it shouldn’t be very hard to fix, so if you want this done quickly you could take a look at submitting a PR to the improbable repo 😃.
We can certainly fix the upper-lower case issue.