Skip to content

Instantly share code, notes, and snippets.

Avatar

Eddie Roosenmaallen eroosenmaallen

View GitHub Profile
@eroosenmaallen
eroosenmaallen / unhandled.js
Last active May 29, 2019 13:58
Demonstration of UnhandledPromiseRejectionWarning
View unhandled.js
// Do a thing poorly and asynchronously
async function doAThingBadly() {
throw new Error('It broke')
}
// node uncaught.js
// Try to await a thing. It will throw, but it seems like the Error
// should bubble up to be caught in the higher-up try-catch, right? Right?
async function doAThing() {