diff options
author | Lee, Bonggi <iyabong@gmail.com> | 2020-08-29 10:20:44 +0300 |
---|---|---|
committer | Antoine du Hamel <duhamelantoine1995@gmail.com> | 2020-10-24 17:11:26 +0300 |
commit | 440edaa6881bc6e4966558a10152b41838f9f28a (patch) | |
tree | d466ac7da972e892e9bfdd38b1f8cbe30c468849 | |
parent | 4ab662815803d873da27357ce4f202291d594ef8 (diff) |
doc: update console.error example
Signed-off-by: Lee, Bonggi <iyabong@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/34964
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
-rw-r--r-- | doc/api/console.md | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/doc/api/console.md b/doc/api/console.md index e8bee883acc..8ede89bcfc3 100644 --- a/doc/api/console.md +++ b/doc/api/console.md @@ -30,7 +30,15 @@ console.log('hello world'); console.log('hello %s', 'world'); // Prints: hello world, to stdout console.error(new Error('Whoops, something bad happened')); -// Prints: [Error: Whoops, something bad happened], to stderr +// Prints error message and stack trace to stderr: +// Error: Whoops, something bad happened +// at [eval]:5:15 +// at Script.runInThisContext (node:vm:132:18) +// at Object.runInThisContext (node:vm:309:38) +// at node:internal/process/execution:77:19 +// at [eval]-wrapper:6:22 +// at evalScript (node:internal/process/execution:76:60) +// at node:internal/main/eval_string:23:3 const name = 'Will Robinson'; console.warn(`Danger ${name}! Danger!`); |