Skip to content

Instantly share code, notes, and snippets.

@eiriklv
Forked from darobin/usable-promises.js
Created February 12, 2016 16:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eiriklv/543e45b15798cde07d41 to your computer and use it in GitHub Desktop.
Save eiriklv/543e45b15798cde07d41 to your computer and use it in GitHub Desktop.
// from the brilliant mind of sb
var _catch = Promise.prototype.catch;
Promise.prototype.catch = function () {
return _catch.call(this, function (err) { setTimeout(function () { throw(err); }, 0); });
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment