How to detect invalid IndexedDB (in Firefox incognito mode for example) when opening PouchDB?

72 views
Skip to first unread message

gleb bahmutov

unread,
Jul 14, 2015, 4:50:38 PM7/14/15
to pou...@googlegroups.com
Hi, I need help detecting invalid IndexedDB and maybe using another adapter. Cannot figure out how to
catch InvalidStateError from idb in Firefox incognito mode.

// I am trying to open PouchDB normally, but this fails in Firefox Incognito mode
var db = new PouchDB('test');
// InvalidStateError
// I see the idb error callback being called if the open request fails
exports.idbError = function (callback) {
return function (event) {
var message = (event.target && event.target.error &&
event.target.error.name) || event.target;
callback(errors.error(errors.IDB_ERROR, message, event.type));
};
};
// I want to catch this error and maybe switch to using memory provider, but do not see
// a way to attach error handler to the PouchDB function

Nolan Lawson

unread,
Jul 20, 2015, 7:41:05 PM7/20/15
to pou...@googlegroups.com, gleb.b...@gmail.com
This issue is being tracked here: https://github.com/pouchdb/pouchdb/issues/4053
Reply all
Reply to author
Forward
0 new messages