diff options
Diffstat (limited to 'lib/tty.js')
-rw-r--r-- | lib/tty.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/tty.js b/lib/tty.js index dfb76bbe53..4e9023b0eb 100644 --- a/lib/tty.js +++ b/lib/tty.js @@ -25,7 +25,7 @@ const { inherits, _extend } = require('util'); const net = require('net'); const { TTY, isTTY } = process.binding('tty_wrap'); const errors = require('internal/errors'); -const { ERR_INVALID_FD } = errors.codes; +const { ERR_INVALID_FD, ERR_TTY_INIT_FAILED } = errors.codes; const readline = require('readline'); const { getColorDepth } = require('internal/tty'); @@ -42,7 +42,7 @@ function ReadStream(fd, options) { const ctx = {}; const tty = new TTY(fd, true, ctx); if (ctx.code !== undefined) { - throw new errors.SystemError(ctx); + throw new ERR_TTY_INIT_FAILED(ctx); } options = _extend({ @@ -74,7 +74,7 @@ function WriteStream(fd) { const ctx = {}; const tty = new TTY(fd, false, ctx); if (ctx.code !== undefined) { - throw new errors.SystemError(ctx); + throw new ERR_TTY_INIT_FAILED(ctx); } net.Socket.call(this, { |