commit bd5d3af9830bce823e5cd4c15723e06d2c6e1c9c
parent d24fe734aaf3e4a412176567dd7bd9be7687a956
Author: Dan Stillman <dstillman@zotero.org>
Date: Tue, 8 Mar 2011 19:25:00 +0000
Better error for file sync login failure
Diffstat:
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/chrome/content/zotero/xpcom/storage/zfs.js b/chrome/content/zotero/xpcom/storage/zfs.js
@@ -846,7 +846,13 @@ Zotero.Sync.Storage.Session.ZFS.prototype.getLastSyncTime = function (callback)
// TODO: move to root uri
uri.spec += "?auth=1";
Zotero.HTTP.doGet(uri, function (req) {
- if (req.status != 200) {
+ if (req.status == 401) {
+ // TODO: localize
+ var msg = "File sync login failed\n\nCheck your username and password in the Sync pane of the Zotero preferences.";
+ self.onError(msg);
+ return;
+ }
+ else if (req.status != 200) {
var msg = "Unexpected status code " + req.status + " caching "
+ "authentication credentials in Zotero.Sync.Storage.Session.ZFS.getLastSyncTime()";
Zotero.debug(msg, 1);
@@ -866,7 +872,7 @@ Zotero.Sync.Storage.Session.ZFS.prototype.getLastSyncTime = function (callback)
}
Zotero.debug(req.status);
- if (req.status == 403) {
+ if (req.status == 401 || req.status == 403) {
Zotero.debug("Clearing ZFS authentication credentials", 2);
self._cachedCredentials = false;
}