Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// Example 1
try {
return await myAsyncFunction();
} catch (err) {
// Any promise rejection while calling myAsyncFunction() will reach here, because of using `await`
}
// Example 2
try {
return myAsyncFunction();
} catch (err) {
// No promise rejection will reach here because the promise is returned to the caller instead of
// resolving it here.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.