-
-
Notifications
You must be signed in to change notification settings - Fork 641
Promise.onuncatched
David Fahlander edited this page Apr 3, 2014
·
4 revisions
Called if the promise wasnt catched.
var p = new Promise(function (resolve, reject) {
reject("Failed!");
});
p.onuncatched = function (e) {
alert ("No-one catched this error: " + e);
}
Result:
Since neither then(x, f), catch(f) or finally(f) was called with valid function f, the alert would be fired.
Dexie uses this event on all returned promises from any DB operation on a Transaction in order to make sure error is propagated to the transaction and that transaction is aborted.
Dexie.js - minimalistic and bullet proof indexedDB library