Skip to content

Commit

Permalink
tty: handle setRawMode errors
Browse files Browse the repository at this point in the history
PR-URL: #22886
Refs: #21773
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
seishun authored and targos committed Sep 20, 2018
1 parent b5c7e40 commit 36028ca
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/tty.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ inherits(ReadStream, net.Socket);

ReadStream.prototype.setRawMode = function(flag) {
flag = !!flag;
this._handle.setRawMode(flag);
const err = this._handle.setRawMode(flag);
if (err) {
this.emit('error', errors.errnoException(err, 'setRawMode'));
return;
}
this.isRaw = flag;
};

Expand Down

0 comments on commit 36028ca

Please sign in to comment.