An update, native promises is now performed on most browsers:
window.addEventListener("unhandledrejection", function(err, promise) {
We just discussed it the other day.
Here is how you would do it with bluebird:
window.onpossiblyunhandledexception = function(){ window.onerror.apply(this, arguments);
With Bluebird, you can also use Promise.onPossiblyUnhandledRejection . Requests for done not needed, since the library detects an unhandled deviation, unlike Q (UPDATE 2016 - now I wrote the code for Q, and he does it).
As for native promises - they will eventually be reported either in window.onerror or in a new handler, but the specification process has not been completed yet - you can follow this here .
Benjamin Gruenbaum Jan 17 '15 at 10:24 2015-01-17 22:24
source share