Skip to content

Commit

Permalink
Handle Bluebird unhandledrejection
Browse files Browse the repository at this point in the history
Bluebird.js promises don't have event.reason, they instead have event.detail.reason. An unhanded rejection from bb causes an exception from your plugin. Given Bluebird's popularity it's probably worthwhile handing this case at least until they fix their side. As you can see they've taken a couple of kicks at this already. Links to their issues:
petkaantonov/bluebird#1447
petkaantonov/bluebird#1509
  • Loading branch information
brenthompson committed Apr 9, 2018
1 parent d6c79da commit 3b99f96
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Expand Up @@ -72,7 +72,7 @@ module.exports = options => {
}, 200);
window.addEventListener('unhandledrejection', event => {
event.preventDefault();
rejectionHandler(event.reason);
rejectionHandler(event.reason || event.detail.reason);
});
} else {
process.on('uncaughtException', err => {
Expand Down

0 comments on commit 3b99f96

Please sign in to comment.