diff --git a/chrome/content/zotero/xpcom/storage.js b/chrome/content/zotero/xpcom/storage.js index b030ba9fb..b0e9d55c3 100644 --- a/chrome/content/zotero/xpcom/storage.js +++ b/chrome/content/zotero/xpcom/storage.js @@ -1658,7 +1658,6 @@ Zotero.Sync.Storage = new function () { if (fileList.length == 0) { Zotero.debug('No files to add -- removing zip file'); tmpFile.remove(null); - request.stop(); return false; } @@ -1670,9 +1669,10 @@ Zotero.Sync.Storage = new function () { zw.processQueue(observer, null); return true; } + // DEBUG: Do we want to catch this? catch (e) { Zotero.debug(e, 1); - request.error(e); + Components.utils.reportError(e); return false; } } @@ -1851,9 +1851,10 @@ Zotero.Sync.Storage.ZipWriterObserver.prototype = { var entry = this._zipWriter.getEntry(fileName); if (!entry) { var msg = "ZIP entry '" + fileName + "' not found for request '" + this._data.request.name + "'"; + Components.utils.reportError(msg); Zotero.debug(msg, 1); this._zipWriter.close(); - this._data.request.error(msg); + this._callback(false); return; } originalSize += entry.realSize; diff --git a/chrome/content/zotero/xpcom/storage/webdav.js b/chrome/content/zotero/xpcom/storage/webdav.js index 108a4eccc..5f794d2f5 100644 --- a/chrome/content/zotero/xpcom/storage/webdav.js +++ b/chrome/content/zotero/xpcom/storage/webdav.js @@ -960,6 +960,10 @@ Zotero.Sync.Storage.WebDAV = (function () { var created = Zotero.Sync.Storage.createUploadFile( request, function (data) { + if (!data) { + deferred.resolve(false); + return; + } deferred.resolve( Q.fcall(function () { return processUploadFile(data); diff --git a/chrome/content/zotero/xpcom/storage/zfs.js b/chrome/content/zotero/xpcom/storage/zfs.js index a93c4c784..5462a0012 100644 --- a/chrome/content/zotero/xpcom/storage/zfs.js +++ b/chrome/content/zotero/xpcom/storage/zfs.js @@ -873,12 +873,19 @@ Zotero.Sync.Storage.ZFS = (function () { var item = Zotero.Sync.Storage.getItemFromRequestName(request.name); if (Zotero.Attachments.getNumFiles(item) > 1) { var deferred = Q.defer(); - Zotero.Sync.Storage.createUploadFile( + var created = Zotero.Sync.Storage.createUploadFile( request, function (data) { + if (!data) { + deferred.resolve(false); + return; + } deferred.resolve(processUploadFile(data)); } ); + if (!created) { + return Q(false); + } return deferred.promise; } else {