From c29720743a6f3ef7dce9ee39fd0415a1c9440f11 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 8 Aug 2013 14:31:53 -0400 Subject: [PATCH] Fix file sync error in Gecko 23+ if local file path is too long --- chrome/content/zotero/xpcom/storage.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/storage.js b/chrome/content/zotero/xpcom/storage.js index 310eb69ee7..b04e7918d0 100644 --- a/chrome/content/zotero/xpcom/storage.js +++ b/chrome/content/zotero/xpcom/storage.js @@ -1058,7 +1058,12 @@ Zotero.Sync.Storage = new function () { } }) .catch(function (e) { - if (e instanceof OS.File.Error && e.becauseNoSuchFile) { + if (e instanceof OS.File.Error && + (e.becauseNoSuchFile + // This can happen if a path is too long on Windows, + // e.g. a file is being accessed on a VM through a share + // (and probably in other cases). + || (e.winLastError && e.winLastError == 3))) { Zotero.debug("Marking attachment " + lk + " as missing"); updatedStates[item.id] = Zotero.Sync.Storage.SYNC_STATE_TO_DOWNLOAD; return;