client does not receive gRPC error
- Dominant language
- JavaScript
- Stars
- 9.3k
- Forks
- 802
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 5
Description
We tried to use grpc-web with [grpcwebproxy](https://github.com/improbable-eng/grpc-web/blob/master/go/grpcwebproxy) and ran into an issue that the client could not receive gPRC error.
1. When server returns an error, our callback gets `{err: null, response: }`.
[`GatewayClientBase.prototype.rpcCall`](https://github.com/grpc/grpc-web/blob/master/javascript/net/grpc/web/gatewayclientbase.js#L57) 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`](https://github.com/grpc/grpc-web/blob/master/javascript/net/grpc/web/grpcwebclientreadablestream.js#L160) while the trailers body contains [`Grpc-Status`](https://github.com/grpc/grpc-go/blob/master/internal/transport/handler_server.go#L263).
We found a related issue https://github.com/improbable-eng/grpc-web/issues/228.
Which component was supposed to handle this case mismatch?
2. Suppose the error "status" issue is fixed. When a gRPC error happens, the client first receives `{err: null, response: }`, then `{err: , response: null}`. The client has to deal with the `` response everywhere, unable to tell easily it was a failure other than calling its getters returning `undefined`. What's recommended pattern for a client to differentiate success vs. error?
Contributor guide
Assessment
This issue has not been assessed yet.