diff --git a/chrome/content/zotero/overlay.js b/chrome/content/zotero/overlay.js index 1c18eb87f7..1257133393 100644 --- a/chrome/content/zotero/overlay.js +++ b/chrome/content/zotero/overlay.js @@ -304,7 +304,9 @@ var ZoteroPane = new function() // TODO: Add a better error page/window here with reporting // instructions // window.loadURI('chrome://zotero/content/error.xul'); - alert(errMsg); + var pr = Components.classes["@mozilla.org/network/default-prompt;1"] + .getService(Components.interfaces.nsIPrompt); + pr.alert("", errMsg); } return; diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js index 1cb6712584..a55bc94712 100644 --- a/chrome/content/zotero/xpcom/zotero.js +++ b/chrome/content/zotero/xpcom/zotero.js @@ -295,6 +295,15 @@ var Zotero = new function(){ Zotero.DB.test(); } catch (e) { + if (e.name == 'NS_ERROR_FILE_ACCESS_DENIED') { + // TODO: localize + var msg = Zotero.localeJoin([ + Zotero.getString('startupError.databaseCannotBeOpened'), + Zotero.getString('startupError.checkPermissions') + ]); + _startupError = msg; + } + Components.utils.reportError(e); this.skipLoading = true; Zotero.DB.skipBackup = true; diff --git a/chrome/locale/en-US/zotero/zotero.properties b/chrome/locale/en-US/zotero/zotero.properties index d036199993..707cd6aa93 100644 --- a/chrome/locale/en-US/zotero/zotero.properties +++ b/chrome/locale/en-US/zotero/zotero.properties @@ -49,6 +49,8 @@ dataDir.selectedDirNonEmpty.title = Directory Not Empty dataDir.selectedDirNonEmpty.text = The directory you selected is not empty and does not appear to be a Zotero data directory.\n\nCreate Zotero files in this directory anyway? startupError = There was an error starting Zotero. +startupError.databaseCannotBeOpened = The Zotero database cannot be opened. +startupError.checkPermissions = Please make sure you have read and write permissions to all files in the Zotero data directory. pane.collections.delete = Are you sure you want to delete the selected collection? pane.collections.deleteSearch = Are you sure you want to delete the selected search?