Node: propagate read errors back down to core

This commit is contained in:
murgatroid99 2016-03-07 17:49:37 -08:00
parent c85428c74b
commit cb72b166fd
1 changed files with 3 additions and 0 deletions

View File

@ -149,6 +149,9 @@ function _readsDone(status) {
if (!status) { if (!status) {
status = {code: grpc.status.OK, details: 'OK'}; status = {code: grpc.status.OK, details: 'OK'};
} }
if (status.code !== grpc.status.OK) {
this.call.cancelWithStatus(status.code, status.details);
}
this.finished = true; this.finished = true;
this.read_status = status; this.read_status = status;
this._emitStatusIfDone(); this._emitStatusIfDone();