Merge pull request #5637 from murgatroid99/node_bad_message_handling
Node: propagate read errors back down to core
diff --git a/src/node/src/client.js b/src/node/src/client.js
index 9cc5a62..2459e28 100644
--- a/src/node/src/client.js
+++ b/src/node/src/client.js
@@ -149,6 +149,9 @@
if (!status) {
status = {code: grpc.status.OK, details: 'OK'};
}
+ if (status.code !== grpc.status.OK) {
+ this.call.cancelWithStatus(status.code, status.details);
+ }
this.finished = true;
this.read_status = status;
this._emitStatusIfDone();