From 9f8510c821cf7240efcb538883b7db683c0e7e2a Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 8 May 2015 02:43:09 -0400 Subject: [PATCH] Throw ZoteroUnknownTypeError on unknown item type in getItemTypeFields This needs to be done in additional places as well. --- chrome/content/zotero/xpcom/data/itemFields.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/data/itemFields.js b/chrome/content/zotero/xpcom/data/itemFields.js index c589560982..6c9681e03c 100644 --- a/chrome/content/zotero/xpcom/data/itemFields.js +++ b/chrome/content/zotero/xpcom/data/itemFields.js @@ -198,7 +198,9 @@ Zotero.ItemFields = new function() { */ function getItemTypeFields(itemTypeID) { if (!itemTypeID) { - throw new Error("Invalid item type id '" + itemTypeID + "'"); + let e = new Error("Invalid item type id '" + itemTypeID + "'"); + e.name = "ZoteroUnknownTypeError"; + throw e; } if (!_itemTypeFieldsLoaded) {