Skip to content

Instantly share code, notes, and snippets.

@kepta

kepta/block19.js Secret

Last active February 21, 2018 15:04
Show Gist options
  • Save kepta/f7936dedfbe5201cf2974986f08ea2fe to your computer and use it in GitHub Desktop.
Save kepta/f7936dedfbe5201cf2974986f08ea2fe to your computer and use it in GitHub Desktop.
.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