From 0d1314770467c4d0e8a390de53c3524264a69ced Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 15 Dec 2009 09:07:07 +0000 Subject: [PATCH] Better debugging for data.syncModTime error, maybe --- chrome/content/zotero/xpcom/storage/webdav.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/storage/webdav.js b/chrome/content/zotero/xpcom/storage/webdav.js index ece5f1c089..8052cfe338 100644 --- a/chrome/content/zotero/xpcom/storage/webdav.js +++ b/chrome/content/zotero/xpcom/storage/webdav.js @@ -264,9 +264,11 @@ Zotero.Sync.Storage.Session.WebDAV.prototype._setStorageModificationTime = funct * @param {Zotero.Sync.Storage.Request} [request] */ Zotero.Sync.Storage.Session.WebDAV.prototype.downloadFile = function (request) { + var funcName = "Zotero.Sync.Storage.Session.WebDAV.downloadFile()"; + var item = Zotero.Sync.Storage.getItemFromRequestName(request.name); if (!item) { - throw ("Item '" + request.name + "' not found in Zotero.Sync.Storage.Session.WebDAV.downloadFile()"); + throw ("Item '" + request.name + "' not found in " + funcName); } var self = this; @@ -280,13 +282,19 @@ Zotero.Sync.Storage.Session.WebDAV.prototype.downloadFile = function (request) { } if (!mdate) { - Zotero.debug("Remote file not found for item " + item.key); + Zotero.debug("Remote file not found for item " + Zotero.Items.getLibraryKeyHash(item)); request.finish(); return; } try { var syncModTime = Zotero.Date.toUnixTimestamp(mdate); + if (!syncModTime) { + var msg = "Invalid mod date '" + mdate + "' for item " + + Zotero.Items.getLibraryKeyHash(item) + " in " + funcName; + Zotero.debug(msg, 1); + throw (msg); + } // Skip download if local file exists and matches mod time var file = item.getFile();