commit e1532c6837d9788353866711090d449ec43fb7c9 parent 4ef7c943744d23714278e95209a022f63876dda8 Author: Dan Stillman <dstillman@zotero.org> Date: Fri, 10 Feb 2012 01:29:34 -0500 Restore proper error if datadir is inaccessible Diffstat:
| M | chrome/content/zotero/xpcom/zotero.js | | | 17 | ++++++++++++++++- |
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js @@ -416,7 +416,22 @@ const ZOTERO_CONFIG = { observerService.removeObserver(_shutdownObserver, "quit-application", false); }); - Zotero.IPC.init(); + 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) {