Skip to content

Instantly share code, notes, and snippets.

@zlatkov
Created January 5, 2021 11:44
Show Gist options
  • Save zlatkov/f36c837e36a5d1c7169c3e3ed0669bdf to your computer and use it in GitHub Desktop.
Save zlatkov/f36c837e36a5d1c7169c3e3ed0669bdf to your computer and use it in GitHub Desktop.
try {
foo(‘test’)
.then(x => console.log(x))
.catch(err => console.log(err)); // The error is handled here.
} catch(err) {
// This block is not reached since the thrown error is inside of a Promise.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment