Created
September 23, 2015 13:58
-
-
Save kimmobrunfeldt/ca58635544e5732ae4d4 to your computer and use it in GitHub Desktop.
Promise catching
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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