Last active
February 21, 2018 02:31
-
-
Save Gaafar/39b83dccf61ff9e86c5e31e297d96300 to your computer and use it in GitHub Desktop.
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
const makeRequest = () => { | |
return callAPromise() | |
.then(() => callAPromise()) | |
.then(() => callAPromise()) | |
.then(() => callAPromise()) | |
.then(() => callAPromise()) | |
.then(() => { | |
throw new Error("oops"); | |
}) | |
} | |
makeRequest() | |
.catch(err => { | |
console.log(err); | |
// output | |
// Error: oops at callAPromise.then.then.then.then.then (index.js:8:13) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
nitpick since you're not using the params, and the example made it seem a bit worse than it was: