From 02f2a5b51cc9251f41b8dfcb2b7833c20f51cd9b Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 25 Nov 2009 02:27:08 +0000 Subject: [PATCH] Auto-reset on a couple "Cannot set source to invalid item" sync errors --- chrome/content/zotero/xpcom/data/item.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js index e2ef4239c..b84ab9e37 100644 --- a/chrome/content/zotero/xpcom/data/item.js +++ b/chrome/content/zotero/xpcom/data/item.js @@ -1373,7 +1373,8 @@ Zotero.Item.prototype.save = function() { if (!newSourceItem) { // TODO: clear caches? - throw ("Cannot set source to invalid item " + this._sourceItem); + var msg = "Cannot set source to invalid item " + this._sourceItem; + var e = new Zotero.Error(msg, "MISSING_OBJECT"); } var newSourceItemNotifierData = {}; @@ -1759,7 +1760,9 @@ Zotero.Item.prototype.save = function() { if (!newSourceItem) { // TODO: clear caches - throw ("Cannot set source to invalid item " + this._sourceItem); + var msg = "Cannot set source to invalid item " + this._sourceItem; + var e = new Zotero.Error(msg, "MISSING_OBJECT"); + throw (e); } var newSourceItemNotifierData = {};