commit 110800f154fd0ed8f91fffbb8e3ac6a7e5e77372
parent eb0dae076be6d19cd38810bfd6a70c05ed6b7d79
Author: Dan Stillman <dstillman@zotero.org>
Date: Thu, 23 Jul 2009 10:52:28 +0000
Display more helpful startup error if file access is denied
Diffstat:
3 files changed, 14 insertions(+), 1 deletion(-)
diff --git 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
@@ -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
@@ -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?