Skip to content

Instantly share code, notes, and snippets.

@kepta

kepta/block20.js Secret

Last active February 21, 2018 15:05
Show Gist options
  • Save kepta/d449d19737d16e15a96d61f92404251b to your computer and use it in GitHub Desktop.
Save kepta/d449d19737d16e15a96d61f92404251b to your computer and use it in GitHub Desktop.
.then(function() {
return Promise.reject(new Error('something wrong happened'));
}).catch(function(e) {
console.error(e); // something wrong happened
});
.then(function() {
return Promise.reject(new Error('something wrong happened'));
}, function(e) { // callback handles error coming from the chain above the current `.then`
console.error(e); // no error logged
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment