diff --git a/chrome/content/zotero/xpcom/data/dataObject.js b/chrome/content/zotero/xpcom/data/dataObject.js index 728e85175..bebcb6e2a 100644 --- a/chrome/content/zotero/xpcom/data/dataObject.js +++ b/chrome/content/zotero/xpcom/data/dataObject.js @@ -584,7 +584,11 @@ Zotero.DataObject.prototype.save = Zotero.Promise.coroutine(function* (options) Zotero.debug(e2, 1); }) .then(function() { - Zotero.debug(e, 1); + // Don't log expected errors + if (e.name != 'ZoteroUnknownFieldError' + && e.name != 'ZoteroMissingObjectError') { + Zotero.debug(e, 1); + } throw e; }) }); diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js index eeba8e79e..0042b84f8 100644 --- a/chrome/content/zotero/xpcom/data/item.js +++ b/chrome/content/zotero/xpcom/data/item.js @@ -1350,8 +1350,10 @@ Zotero.Item.prototype._saveData = Zotero.Promise.coroutine(function* (env) { if (isNew) { if (!parentItemID) { // TODO: clear caches? - let msg = parentItemKey + " is not a valid item key"; - throw new Zotero.Error(msg, "MISSING_OBJECT"); + let msg = "Parent item " + this.libraryID + "/" + parentItemKey + " not found"; + let e = new Error(msg); + e.name = "ZoteroMissingObjectError"; + throw e; } let newParentItemNotifierData = {}; @@ -1372,8 +1374,10 @@ Zotero.Item.prototype._saveData = Zotero.Promise.coroutine(function* (env) { if (parentItemKey) { if (!parentItemID) { // TODO: clear caches - let msg = "Cannot set source to invalid item " + parentItemKey; - throw new Zotero.Error(msg, "MISSING_OBJECT"); + let msg = "Parent item " + this.libraryID + "/" + parentItemKey + " not found"; + let e = new Error(msg); + e.name = "ZoteroMissingObjectError"; + throw e; } let newParentItemNotifierData = {};