commit 0e800f350c02bc7ff8f7d0c832a0b76f1663babb parent f68a595a2bc11ce2b1895b2182dc39c1ad349935 Author: Dan Stillman <dstillman@zotero.org> Date: Tue, 21 Apr 2015 23:36:06 -0400 Throw errors instead of logging for some item load calls Reverts a change in b83bc404, and changes one debug line introduced there into an error Diffstat:
| M | chrome/content/zotero/xpcom/data/item.js | | | 6 | ++---- |
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js @@ -4257,8 +4257,7 @@ Zotero.Item.prototype.loadNote = Zotero.Promise.coroutine(function* (reload) { } if (!this.isNote() && !this.isAttachment()) { - Zotero.debug("Can only load note for note or attachment item"); - return; + throw new Error("Can only load note for note or attachment item"); } Zotero.debug("Loading note data for item " + this.libraryKey); @@ -4456,8 +4455,7 @@ Zotero.Item.prototype.loadChildItems = Zotero.Promise.coroutine(function* (reloa if (this.isNote() || this.isAttachment()) { - Zotero.debug("Can only load child items for regular item"); - return; + throw new Error("Can only load child items for regular item"); } // Attachments