Skip to content

Instantly share code, notes, and snippets.

@tkissing
Created March 31, 2015 08:41
Show Gist options
  • Save tkissing/786bd8381fd5688bb9c9 to your computer and use it in GitHub Desktop.
Save tkissing/786bd8381fd5688bb9c9 to your computer and use it in GitHub Desktop.
Careful when using .then(successHandler, errorHandler) - it might not do what you mean to do!
(function() {
p = Promise.resolve(3);
p.then(function() { throw Error('e'); }, console.warn.bind(console, 'You will not see this one'));
p.then(function() { throw Error('e'); }).then(null, console.warn.bind(console, 'You will see this one'));
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment