Restore proper error if datadir is inaccessible

This commit is contained in:
Dan Stillman 2012-02-10 01:29:34 -05:00
parent 4ef7c94374
commit e1532c6837

View file

@ -416,7 +416,22 @@ const ZOTERO_CONFIG = {
observerService.removeObserver(_shutdownObserver, "quit-application", false);
});
try {
Zotero.IPC.init();
}
catch (e) {
if (e.name == 'NS_ERROR_FILE_ACCESS_DENIED') {
var msg = Zotero.localeJoin([
Zotero.getString('startupError.databaseCannotBeOpened'),
Zotero.getString('startupError.checkPermissions')
]);
Zotero.startupError = msg;
Zotero.debug(e);
Components.utils.reportError(e);
return false;
}
throw (e);
}
// Load additional info for connector or not
if(Zotero.isConnector) {