Closed art-in closed 9 years ago
Hopefully then/promise
has non standard .done() method, which throws unhandled rejection outside the promise. So it is not a problem for me anymore.
promise
.then(function() {
throw 'BOOM'
})
.done() // exception thrown outside
I've been thinking about reducing the scope of this package so that users have to provide their own Promise
implementation, which should make it easier to use in an existing environment where you already have a preferred polyfill. Would that be better for you, even though you found a workaround in this case?
@benjamn Yes, I think such option still would be better.
Namely because then/promise
forces me to use non Promise+ standard .done()
method.
I've noticed that with default Meteor's
then/promise
polyfill there is no way to catch unhandled rejections. https://github.com/then/promise/issues/70To solve this I'm looking for some way to replace
then/promise
withpetkaantonov/bluebird
, since bluebird can doprocess.on("unhandledRejection", function() {...})
I've tried to
meteor add mvrx:bluebird
, but looks like Meteor's core promise polyfill hides bluebird since"unhandledRejection"
does not catch, and this fails:if (!Promise.noConflict) { throw Error('NO BLUEBIRD'); }
Any ideas?