Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nem035/5b3c77cad88459e792676344bc136a0b to your computer and use it in GitHub Desktop.
Save nem035/5b3c77cad88459e792676344bc136a0b to your computer and use it in GitHub Desktop.
// this doesn't work
try {
httpGet(function callback() {
// an error caused asynchronously
// cannot be caught via a callback
// mechanism
})
} catch (err) {
// this will only get called if httpGet
// itself throws a synchronous error
// but not if our callback throws an
// error instead.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment