Show error icon at startup if proxy check fails

If a proxy is required and we can't connect to S3, show the (sync) error
icon. For SSL certificate errors, which are the most common cause of
this, the panel includes a link to the SSL cert troubleshooting page.
This commit is contained in:
Dan Stillman 2018-08-09 06:11:33 -04:00
parent 0f19872a8d
commit 168bc78f1a
3 changed files with 20 additions and 4 deletions

View file

@ -651,10 +651,13 @@ Zotero.HTTP = new function() {
dontCache: true
})
.catch(function (e) {
Components.utils.reportError(e);
var msg = "Error connecting to proxy -- proxied requests may not work";
Zotero.log(msg, 'error');
Zotero.debug(msg, 1);
// Show error icon at startup
if (e instanceof Zotero.HTTP.SecurityException) {
Zotero.proxyFailure = e;
}
Zotero.logError(e);
let msg = "Error connecting to proxy -- proxied requests may not work";
Zotero.logError(msg);
});
break;
}

View file

@ -481,6 +481,18 @@ var ZoteroPane = new function()
Zotero.Prefs.set(pref, true);
}
if (Zotero.proxyFailure) {
try {
Zotero.proxyFailure.message += "\n\n"
+ Zotero.getString('startupError.internetFunctionalityMayNotWork');
Zotero.Sync.Runner.updateIcons(Zotero.proxyFailure);
Zotero.proxyFailure = null;
}
catch (e) {
Zotero.logError(e);
}
}
// Auto-sync on pane open or if new account
if (Zotero.Prefs.get('sync.autoSync') || Zotero.initAutoSync) {
yield Zotero.proxyAuthComplete;

View file

@ -185,6 +185,7 @@ startupError.incompatibleDBVersion = This %1$S database requires %1$S %2
startupError.zoteroVersionIsOlder.current = Current version: %S
startupError.zoteroVersionIsOlder.upgrade = Please upgrade to the latest version from %S.
startupError.databaseUpgradeError = Database upgrade error
startupError.internetFunctionalityMayNotWork = Functionality that depends on an internet connection may not work.
date.relative.secondsAgo.one = 1 second ago
date.relative.secondsAgo.multiple = %S seconds ago