Skip to content

Commit a82fc30

Browse files
seishundanbev
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 28902f3 commit a82fc30

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
@@ -68,7 +68,11 @@ inherits(ReadStream, net.Socket);
6868

6969
ReadStream.prototype.setRawMode = function(flag) {
7070
flag = !!flag;
71-
this._handle.setRawMode(flag);
71+
const err = this._handle.setRawMode(flag);
72+
if (err) {
73+
this.emit('error', errors.errnoException(err, 'setRawMode'));
74+
return;
75+
}
7276
this.isRaw = flag;
7377
};
7478

0 commit comments

Comments
 (0)