| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent f8426d9 commit 331c0a8
1 file changed
| 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 | |
| Back | FazBrowse Home | New Git URL |
0 commit comments