From 7008fa41cfacc75d07efb3e0ba6c3ae0a9e27be4 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 6 Jul 2009 10:40:10 +0000 Subject: [PATCH] - Fix error in previous commit - Log stack trace to error console on sync errors --- chrome/content/zotero/xpcom/data/item.js | 2 +- chrome/content/zotero/xpcom/sync.js | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js index 80f96a51b5..6193d67c0c 100644 --- a/chrome/content/zotero/xpcom/data/item.js +++ b/chrome/content/zotero/xpcom/data/item.js @@ -1763,7 +1763,7 @@ Zotero.Item.prototype.save = function() { if (this._previousData) { var oldSourceItemKey = this._previousData.sourceItemKey; if (oldSourceItemKey) { - var oldSourceItem = Zotero.Items.getByKey(this.libraryID, oldSourceItemKey); + var oldSourceItem = Zotero.Items.getByLibraryAndKey(this.libraryID, oldSourceItemKey); } if (oldSourceItem) { var oldSourceItemNotifierData = {}; diff --git a/chrome/content/zotero/xpcom/sync.js b/chrome/content/zotero/xpcom/sync.js index 870145cabc..583f41dfde 100644 --- a/chrome/content/zotero/xpcom/sync.js +++ b/chrome/content/zotero/xpcom/sync.js @@ -1720,6 +1720,15 @@ Zotero.Sync.Server = new function () { Zotero.Sync.Runner.setError(e.message ? e.message : e); Zotero.Sync.Runner.reset(); + try { + undefinedFunction(); + } + catch (e) { + // Log stack trace to error console + if (e.stack) { + Components.utils.reportError(e.stack.substr(0, 600)); + } + } Components.utils.reportError(e); } }