Skip to content

Commit 07845fc

Browse files
BridgeARMylesBorins
authored andcommitted
console: port errors to new system
This ports the errors to the new error system. Backport-PR-URL: #19244 PR-URL: #18857 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
1 parent ffa16aa commit 07845fc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/console.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
'use strict';
2323

24-
const errors = require('internal/errors');
24+
const { ERR_CONSOLE_WRITABLE_STREAM } = require('internal/errors').codes;
2525
const util = require('util');
2626
const kCounts = Symbol('counts');
2727

@@ -35,12 +35,12 @@ function Console(stdout, stderr, ignoreErrors = true) {
3535
return new Console(stdout, stderr, ignoreErrors);
3636
}
3737
if (!stdout || typeof stdout.write !== 'function') {
38-
throw new errors.TypeError('ERR_CONSOLE_WRITABLE_STREAM', 'stdout');
38+
throw new ERR_CONSOLE_WRITABLE_STREAM('stdout');
3939
}
4040
if (!stderr) {
4141
stderr = stdout;
4242
} else if (typeof stderr.write !== 'function') {
43-
throw new errors.TypeError('ERR_CONSOLE_WRITABLE_STREAM', 'stderr');
43+
throw new ERR_CONSOLE_WRITABLE_STREAM('stderr');
4444
}
4545

4646
var prop = {

0 commit comments

Comments
 (0)