From e95a919c12aa4acd8070c3229f74126d850a1df3 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sun, 14 Nov 2010 00:38:05 +0000 Subject: [PATCH] Display more helpful error message for nsIFile.remove() error --- chrome/content/zotero/xpcom/storage/zfs.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/storage/zfs.js b/chrome/content/zotero/xpcom/storage/zfs.js index c7ccae5bc9..dac51367d9 100644 --- a/chrome/content/zotero/xpcom/storage/zfs.js +++ b/chrome/content/zotero/xpcom/storage/zfs.js @@ -237,7 +237,20 @@ Zotero.Sync.Storage.Session.ZFS.prototype.downloadFile = function (request) { } if (destFile.exists()) { - destFile.remove(false); + try { + destFile.remove(false); + } + catch (e) { + // TODO: localize + var msg = "Zotero was unable to delete a temporary file in " + + destFile.parent.path + " during syncing." + + "\n\n" + + "Restarting your computer or disabling anti-virus/security " + + "software may fix the problem."; + Zotero.debug(e, 1); + Components.utils.reportError(e); + self.onError(msg); + } } // saveURI() below appears not to create empty files for Content-Length: 0,