Skip to content

Instantly share code, notes, and snippets.

@kimmobrunfeldt
Created September 23, 2015 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kimmobrunfeldt/ca58635544e5732ae4d4 to your computer and use it in GitHub Desktop.
Save kimmobrunfeldt/ca58635544e5732ae4d4 to your computer and use it in GitHub Desktop.
Promise catching
// Version 1
a()
.then(b)
.then(c)
.then(success, error); // Here the error handler does NOT catch errors thrown in the success handler
// Version 2
a()
.then(b)
.then(c)
.then(success)
.catch(error); // Here the error handler DOES catch errors thrown in the success handler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment