{"action":"created","issue":{"url":"https://api.github.com/repos/grpc/grpc-web/issues/343","repository_url":"https://api.github.com/repos/grpc/grpc-web","labels_url":"https://api.github.com/repos/grpc/grpc-web/issues/343/labels{/name}","comments_url":"https://api.github.com/repos/grpc/grpc-web/issues/343/comments","events_url":"https://api.github.com/repos/grpc/grpc-web/issues/343/events","html_url":"https://github.com/grpc/grpc-web/issues/343","id":374049396,"node_id":"MDU6SXNzdWUzNzQwNDkzOTY=","number":343,"title":"client does not receive gRPC error","user":{"login":"jianchun","id":11861955,"node_id":"MDQ6VXNlcjExODYxOTU1","avatar_url":"https://avatars3.githubusercontent.com/u/11861955?v=4","gravatar_id":"","url":"https://api.github.com/users/jianchun","html_url":"https://github.com/jianchun","followers_url":"https://api.github.com/users/jianchun/followers","following_url":"https://api.github.com/users/jianchun/following{/other_user}","gists_url":"https://api.github.com/users/jianchun/gists{/gist_id}","starred_url":"https://api.github.com/users/jianchun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jianchun/subscriptions","organizations_url":"https://api.github.com/users/jianchun/orgs","repos_url":"https://api.github.com/users/jianchun/repos","events_url":"https://api.github.com/users/jianchun/events{/privacy}","received_events_url":"https://api.github.com/users/jianchun/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-10-25T17:19:45Z","updated_at":"2018-10-25T20:20:06Z","closed_at":null,"author_association":"NONE","body":"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.\r\n\r\n1. When server returns an error, our callback gets `{err: null, response: <empty>}`.\r\n\r\n[`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).\r\n\r\nWe found a related issue https://github.com/improbable-eng/grpc-web/issues/228.\r\n\r\nWhich component was supposed to handle this case mismatch?\r\n\r\n2. 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 returning `undefined`. What's recommended pattern for a client to differentiate success vs. error?"},"comment":{"url":"https://api.github.com/repos/grpc/grpc-web/issues/comments/433191686","html_url":"https://github.com/grpc/grpc-web/issues/343#issuecomment-433191686","issue_url":"https://api.github.com/repos/grpc/grpc-web/issues/343","id":433191686,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMzE5MTY4Ng==","user":{"login":"johanbrandhorst","id":6604151,"node_id":"MDQ6VXNlcjY2MDQxNTE=","avatar_url":"https://avatars2.githubusercontent.com/u/6604151?v=4","gravatar_id":"","url":"https://api.github.com/users/johanbrandhorst","html_url":"https://github.com/johanbrandhorst","followers_url":"https://api.github.com/users/johanbrandhorst/followers","following_url":"https://api.github.com/users/johanbrandhorst/following{/other_user}","gists_url":"https://api.github.com/users/johanbrandhorst/gists{/gist_id}","starred_url":"https://api.github.com/users/johanbrandhorst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johanbrandhorst/subscriptions","organizations_url":"https://api.github.com/users/johanbrandhorst/orgs","repos_url":"https://api.github.com/users/johanbrandhorst/repos","events_url":"https://api.github.com/users/johanbrandhorst/events{/privacy}","received_events_url":"https://api.github.com/users/johanbrandhorst/received_events","type":"User","site_admin":false},"created_at":"2018-10-25T20:20:06Z","updated_at":"2018-10-25T20:20:06Z","author_association":"COLLABORATOR","body":"I think the in-body trailers fail, but early-response headers should still work?"}}
{"actor":{"display_login":"johanbrandhorst"}}