Created
October 24, 2020 08:40
-
-
Save jamesseanwright/30d25d463a702321b9d559b1edc42be7 to your computer and use it in GitHub Desktop.
Unhandled rejections in Node.js 12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| const microtasks = () => new Promise(res => { | |
| setImmediate(res); | |
| }); | |
| (async () => { | |
| try { | |
| const retrieve = Promise.reject(new Error('No')); | |
| await microtasks(); | |
| await retrieve; | |
| } catch (e) { | |
| console.error('CAUGHT!', e); | |
| } | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment