Skip to content

Commit

Permalink
console: port errors to new system
Browse files Browse the repository at this point in the history
This ports the errors to the new error system.

Backport-PR-URL: #19244
PR-URL: #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>
  • Loading branch information
BridgeAR authored and MylesBorins committed Mar 21, 2018
1 parent ffa16aa commit 07845fc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/console.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand All @@ -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 = {
Expand Down

0 comments on commit 07845fc

Please sign in to comment.