Include actual error in "There was an error starting Zotero." dialog

And use a proper title
This commit is contained in:
Dan Stillman 2013-11-27 16:08:31 -05:00
parent b7cba469f0
commit 84882c8ecf
2 changed files with 13 additions and 10 deletions

View file

@ -831,6 +831,8 @@ Components.utils.import("resource://gre/modules/osfile.jsm");
Zotero.getString(Zotero.isStandalone ? 'startupError.closeFirefox' : 'startupError.closeStandalone') Zotero.getString(Zotero.isStandalone ? 'startupError.closeFirefox' : 'startupError.closeStandalone')
]); ]);
Zotero.startupError = msg; Zotero.startupError = msg;
} else {
Zotero.startupError = Zotero.getString('startupError') + "\n\n" + e;
} }
Zotero.debug(e.toString(), 1); Zotero.debug(e.toString(), 1);

View file

@ -3997,16 +3997,17 @@ var ZoteroPane = new function()
var errFunc = Zotero.startupErrorHandler; var errFunc = Zotero.startupErrorHandler;
} }
if (!errMsg) { // Get the stringbundle manually
// Get the stringbundle manually var src = 'chrome://zotero/locale/zotero.properties';
var src = 'chrome://zotero/locale/zotero.properties'; var localeService = Components.classes['@mozilla.org/intl/nslocaleservice;1'].
var localeService = Components.classes['@mozilla.org/intl/nslocaleservice;1']. getService(Components.interfaces.nsILocaleService);
getService(Components.interfaces.nsILocaleService); var appLocale = localeService.getApplicationLocale();
var appLocale = localeService.getApplicationLocale(); var stringBundleService = Components.classes["@mozilla.org/intl/stringbundle;1"]
var stringBundleService = Components.classes["@mozilla.org/intl/stringbundle;1"] .getService(Components.interfaces.nsIStringBundleService);
.getService(Components.interfaces.nsIStringBundleService); var stringBundle = stringBundleService.createBundle(src, appLocale);
var stringBundle = stringBundleService.createBundle(src, appLocale);
var title = stringBundle.GetStringFromName('general.error');
if (!errMsg) {
var errMsg = stringBundle.GetStringFromName('startupError'); var errMsg = stringBundle.GetStringFromName('startupError');
} }
@ -4022,7 +4023,7 @@ var ZoteroPane = new function()
//} else { //} else {
var ps = Components.classes["@mozilla.org/embedcomp/prompt-service;1"] var ps = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
.getService(Components.interfaces.nsIPromptService); .getService(Components.interfaces.nsIPromptService);
ps.alert(null, "", errMsg); ps.alert(null, title, errMsg);
//} //}
} }
} }