From 10e9c5e0b79d6e8251775a169f56f33752e32b0d Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 8 Jul 2013 20:13:47 -0400 Subject: [PATCH] Restore ZFS quota warning Possible that this hasn't shown since 4.0? --- .../content/zotero/xpcom/storage/eventLog.js | 94 ------------------- chrome/content/zotero/xpcom/storage/zfs.js | 6 +- components/zotero-service.js | 1 - 3 files changed, 2 insertions(+), 99 deletions(-) delete mode 100644 chrome/content/zotero/xpcom/storage/eventLog.js diff --git a/chrome/content/zotero/xpcom/storage/eventLog.js b/chrome/content/zotero/xpcom/storage/eventLog.js deleted file mode 100644 index 05be22b7c..000000000 --- a/chrome/content/zotero/xpcom/storage/eventLog.js +++ /dev/null @@ -1,94 +0,0 @@ -/* - ***** BEGIN LICENSE BLOCK ***** - - Copyright © 2012 Center for History and New Media - George Mason University, Fairfax, Virginia, USA - http://zotero.org - - This file is part of Zotero. - - Zotero is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - Zotero is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with Zotero. If not, see . - - ***** END LICENSE BLOCK ***** -*/ - -Zotero.Sync.Storage.EventLog = (function () { - // Non-library-specific - var _general = { warnings: [], errors: [] }; - // Library-specific - var _warnings = {}; - var _errors = {}; - - function call(type, data, libraryID) { - if (libraryID) { - switch (type) { - case 'warning': - var target = _general.warnings; - break; - - case 'error': - var target = _general.errors; - break; - } - } - else { - switch (type) { - case 'warning': - var target = _warnings; - break; - - case 'error': - var target = _errors; - break; - } - } - - if (!target[libraryID]) { - target[libraryID] = []; - } - - target[libraryID].push(data); - - Zotero.debug(data, type == 'error' ? 1 : 2); - Components.utils.reportError(new Error(data)); - } - - return { - error: function (e, libraryID) call('error', e, libraryID), - warning: function (e, libraryID) call('warning', e, libraryID), - - clear: function (libraryID) { - var queues = Zotero.Sync.Storage.QueueManager.getAll(); - for each(var queue in queues) { - if (queue.isRunning()) { - Zotero.debug(queue.name[0].toUpperCase() + queue.name.substr(1) - + " queue not empty -- not clearing storage sync event observers"); - return; - } - } - - if (typeof libraryID == 'undefined') { - Zotero.debug("Clearing file sync event log"); - _general = { warnings: [], errors: [] }; - _warnings = {}; - _errors = {}; - } - else { - Zotero.debug("Clearing file sync event log for library " + libraryID); - _warnings[libraryID] = []; - _errors[libraryID] = []; - } - } - }; -}()); diff --git a/chrome/content/zotero/xpcom/storage/zfs.js b/chrome/content/zotero/xpcom/storage/zfs.js index fa3a30321..59dd06670 100644 --- a/chrome/content/zotero/xpcom/storage/zfs.js +++ b/chrome/content/zotero/xpcom/storage/zfs.js @@ -321,12 +321,10 @@ Zotero.Sync.Storage.ZFS = (function () { dialogButtonCallback: buttonCallback } ); + e.errorMode = 'warning'; Zotero.debug(e, 2); Components.utils.reportError(e); - // Stop uploads from this library, log warning, and continue - Zotero.Sync.Storage.QueueManager.get('upload', item.libraryID).stop(); - Zotero.Sync.Storage.EventLog.warning(e, item.libraryID); - return false; + throw e; } else if (e.status == 403) { var groupID = Zotero.Groups.getGroupIDFromLibraryID(item.libraryID); diff --git a/components/zotero-service.js b/components/zotero-service.js index 5bf0746f7..e00edaa59 100644 --- a/components/zotero-service.js +++ b/components/zotero-service.js @@ -94,7 +94,6 @@ const xpcomFilesLocal = [ 'sync', 'storage', 'storage/streamListener', - 'storage/eventLog', 'storage/queueManager', 'storage/queue', 'storage/request',