From 07845fc19e496ee30c00a4abd10e3c8b4072f1f2 Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Mon, 19 Feb 2018 01:51:58 +0100 Subject: [PATCH] console: port errors to new system This ports the errors to the new error system. Backport-PR-URL: https://github.com/nodejs/node/pull/19244 PR-URL: https://github.com/nodejs/node/pull/18857 Reviewed-By: Anna Henningsen Reviewed-By: Gus Caplan Reviewed-By: James M Snell Reviewed-By: Joyee Cheung --- lib/console.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/console.js b/lib/console.js index ac75664e850e56..ad6276297f26f7 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 = {