Skip to content

Instantly share code, notes, and snippets.

@SegersIan
Created April 17, 2019 08:29
Show Gist options
  • Save SegersIan/2373fc10379efb97224bd5b22cf56c45 to your computer and use it in GitHub Desktop.
Save SegersIan/2373fc10379efb97224bd5b22cf56c45 to your computer and use it in GitHub Desktop.
async function thisThrows() {
throw new Error("Thrown from thisThrows()");
}
try {
thisThrows();
} catch (e) {
console.error(e);
} finally {
console.log('We do cleanup here');
}
// output:
// We do cleanup here
// UnhandledPromiseRejectionWarning: Error: Thrown from thisThrows()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment