-
-
Save kepta/f7936dedfbe5201cf2974986f08ea2fe 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
.then(() => 5.length) // <-- something wrong happenned here | |
.catch(e => { | |
errorLogger(e); // do something impure | |
return Promise.reject(e); // reject it, Yes you can do that! | |
}) | |
.then(r => { | |
console.log(r); // this .then (or any subsequent .then) will never be called as we rejected it above :) | |
}) | |
.catch(e => { | |
console.error(e); //<-- it becomes this catch's problem | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment