Skip to content

Commit 36028ca

Browse files
seishuntargos
authored andcommitted
tty: handle setRawMode errors
PR-URL: #22886 Refs: #21773 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent b5c7e40 commit 36028ca

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/tty.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,11 @@ inherits(ReadStream, net.Socket);
6363

6464
ReadStream.prototype.setRawMode = function(flag) {
6565
flag = !!flag;
66-
this._handle.setRawMode(flag);
66+
const err = this._handle.setRawMode(flag);
67+
if (err) {
68+
this.emit('error', errors.errnoException(err, 'setRawMode'));
69+
return;
70+
}
6771
this.isRaw = flag;
6872
};
6973

0 commit comments

Comments
 (0)