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‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
'use strict';
2323

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

@@ -35,12 +35,12 @@ function Console(stdout, stderr, ignoreErrors = true){
3535
returnnewConsole(stdout,stderr,ignoreErrors);
3636
}
3737
if(!stdout||typeofstdout.write!=='function'){
38-
thrownewerrors.TypeError('ERR_CONSOLE_WRITABLE_STREAM','stdout');
38+
thrownewERR_CONSOLE_WRITABLE_STREAM('stdout');
3939
}
4040
if(!stderr){
4141
stderr=stdout;
4242
}elseif(typeofstderr.write!=='function'){
43-
thrownewerrors.TypeError('ERR_CONSOLE_WRITABLE_STREAM','stderr');
43+
thrownewERR_CONSOLE_WRITABLE_STREAM('stderr');
4444
}
4545

4646
varprop={

0 commit comments

Comments
(0)