summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2018-02-19 01:51:58 +0100
committerRuben Bridgewater <ruben@bridgewater.de>2018-02-22 13:36:22 +0000
commit7c8beb5b5f35875811d6e44e9a03907c03a39bb5 (patch)
treeb24ad8651b66b65261dee39ae02761bc7d2107be /lib
parent6e1c25c45672b70f4b6c6c8af56d9c0762bfae04 (diff)
downloadandroid-node-v8-7c8beb5b5f35875811d6e44e9a03907c03a39bb5.tar.gz
android-node-v8-7c8beb5b5f35875811d6e44e9a03907c03a39bb5.tar.bz2
android-node-v8-7c8beb5b5f35875811d6e44e9a03907c03a39bb5.zip
console: port errors to new system
This ports the errors to the new error system. PR-URL: https://github.com/nodejs/node/pull/18857 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/console.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/console.js b/lib/console.js
index e216934a7f..b77832b987 100644
--- a/lib/console.js
+++ b/lib/console.js
@@ -21,7 +21,7 @@
'use strict';
-const errors = require('internal/errors');
+const { ERR_CONSOLE_WRITABLE_STREAM } = require('internal/errors').codes;
const util = require('util');
const kCounts = Symbol('counts');
@@ -35,12 +35,12 @@ function Console(stdout, stderr, ignoreErrors = true) {
return new Console(stdout, stderr, ignoreErrors);
}
if (!stdout || typeof stdout.write !== 'function') {
- throw new errors.TypeError('ERR_CONSOLE_WRITABLE_STREAM', 'stdout');
+ throw new ERR_CONSOLE_WRITABLE_STREAM('stdout');
}
if (!stderr) {
stderr = stdout;
} else if (typeof stderr.write !== 'function') {
- throw new errors.TypeError('ERR_CONSOLE_WRITABLE_STREAM', 'stderr');
+ throw new ERR_CONSOLE_WRITABLE_STREAM('stderr');
}
var prop = {