-
-
Notifications
You must be signed in to change notification settings - Fork 648
Promise.on.error
David Fahlander edited this page Mar 20, 2015
·
7 revisions
Global exception handler for non-catched promises.
Since Dexie 1.0.4
Dexie.Promise.on("error", myGlobalErrorHandler);
function myGlobalErrorHandler(error) {
console.error(error);
}
Dexie.Promise.on("error").unsubscribe(myGlobalErrorHandler);
error: Any | Any uncatched error no matter if it was a DB operation or any other non-db operation. |
This event will fire whenever a Dexie.Promise instance was rejected and not directly catched.
Dexie.Promise.on("error", function (e) { console.error (e.stack || e); });
new Dexie.Promise(function () {
throw "Oops!";
});
// promise not catched, so the error will bubble to Dexie.Promise.on('error').
Dexie.js - minimalistic and bullet proof indexedDB library