Skip to content

Commit cd8c82a

Browse files
iyabongBethGriggs
authored andcommitted
doc: update console.error example
Signed-off-by: Lee, Bonggi <[email protected]> PR-URL: #34964 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
1 parent c15e8a5 commit cd8c82a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

doc/api/console.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,15 @@ console.log('hello world');
3030
console.log('hello %s', 'world');
3131
// Prints: hello world, to stdout
3232
console.error(new Error('Whoops, something bad happened'));
33-
// Prints: [Error: Whoops, something bad happened], to stderr
33+
// Prints error message and stack trace to stderr:
34+
// Error: Whoops, something bad happened
35+
// at [eval]:5:15
36+
// at Script.runInThisContext (node:vm:132:18)
37+
// at Object.runInThisContext (node:vm:309:38)
38+
// at node:internal/process/execution:77:19
39+
// at [eval]-wrapper:6:22
40+
// at evalScript (node:internal/process/execution:76:60)
41+
// at node:internal/main/eval_string:23:3
3442

3543
const name = 'Will Robinson';
3644
console.warn(`Danger ${name}! Danger!`);

0 commit comments

Comments
 (0)