Skip to content

Commit 331c0a8

Browse files
vsemozhetbytMylesBorins
authored andcommitted
doc: console.log() -> console.error() in events.md
PR-URL: #11810 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent f8426d9 commit 331c0a8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

doc/api/events.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ can be used. (_Note, however, that the `domain` module has been deprecated_)
148148
const myEmitter = new MyEmitter();
149149

150150
process.on('uncaughtException', (err) => {
151-
console.log('whoops! there was an error');
151+
console.error('whoops! there was an error');
152152
});
153153

154154
myEmitter.emit('error', new Error('whoops!'));
@@ -160,7 +160,7 @@ As a best practice, listeners should always be added for the `'error'` events.
160160
```js
161161
const myEmitter = new MyEmitter();
162162
myEmitter.on('error', (err) => {
163-
console.log('whoops! there was an error');
163+
console.error('whoops! there was an error');
164164
});
165165
myEmitter.emit('error', new Error('whoops!'));
166166
// Prints: whoops! there was an error

0 commit comments

Comments
 (0)