GeezerVison is showing github.com — doc: console.log() -> console.error() in events.md · nodejs/node@331c0a8
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: doc/api/events.md +2-2Lines changed: 2 additions & 2 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -148,7 +148,7 @@ can be used. (_Note, however, that the `domain` module has been deprecated_) |
148 | 148 | const myEmitter = new MyEmitter(); |
149 | 149 |
|
150 | 150 | process.on('uncaughtException', (err) => { |
151 | | - console.log('whoops! there was an error'); |
| 151 | + console.error('whoops! there was an error'); |
152 | 152 | }); |
153 | 153 |
|
154 | 154 | myEmitter.emit('error', new Error('whoops!')); |
@@ -160,7 +160,7 @@ As a best practice, listeners should always be added for the `'error'` events. |
160 | 160 | ```js |
161 | 161 | const myEmitter = new MyEmitter(); |
162 | 162 | myEmitter.on('error', (err) => { |
163 | | - console.log('whoops! there was an error'); |
| 163 | + console.error('whoops! there was an error'); |
164 | 164 | }); |
165 | 165 | myEmitter.emit('error', new Error('whoops!')); |
166 | 166 | // Prints: whoops! there was an error |
|