diff options
author | Gautam Mittal <200mittalgautam@gmail.com> | 2017-05-26 08:55:18 -0400 |
---|---|---|
committer | Michael Dawson <michael_dawson@ca.ibm.com> | 2017-06-06 11:55:15 -0400 |
commit | 3630ed1c827fd02e447b733865ebd6214b478a41 (patch) | |
tree | 8a81f85e2a0e8c79ce4fba077a17c671d5bc9f41 /lib/tty.js | |
parent | f06c05cf5a2c2678a76c15adbe7f3acbc9478617 (diff) | |
download | android-node-v8-3630ed1c827fd02e447b733865ebd6214b478a41.tar.gz android-node-v8-3630ed1c827fd02e447b733865ebd6214b478a41.tar.bz2 android-node-v8-3630ed1c827fd02e447b733865ebd6214b478a41.zip |
errors,tty: migrate to use internal/errors.js
PR-URL: https://github.com/nodejs/node/pull/13240
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
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 d467c82781..1d6cc5c688 100644 --- a/lib/tty.js +++ b/lib/tty.js @@ -27,7 +27,7 @@ const TTY = process.binding('tty_wrap').TTY; const isTTY = process.binding('tty_wrap').isTTY; const inherits = util.inherits; const errnoException = util._errnoException; - +const errors = require('internal/errors'); exports.isatty = function(fd) { return isTTY(fd); @@ -38,7 +38,7 @@ function ReadStream(fd, options) { if (!(this instanceof ReadStream)) return new ReadStream(fd, options); if (fd >> 0 !== fd || fd < 0) - throw new RangeError('fd must be positive integer: ' + fd); + throw new errors.RangeError('ERR_INVALID_FD', fd); options = util._extend({ highWaterMark: 0, @@ -67,7 +67,7 @@ function WriteStream(fd) { if (!(this instanceof WriteStream)) return new WriteStream(fd); if (fd >> 0 !== fd || fd < 0) - throw new RangeError('fd must be positive integer: ' + fd); + throw new errors.RangeError('ERR_INVALID_FD', fd); net.Socket.call(this, { handle: new TTY(fd, false), |