From 90d8363b0f15cbdc77abece581608b77bb4bbf12 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Fri, 17 Feb 2012 21:40:19 -0500 Subject: [PATCH] Make sure updateDocument throws a visible error --- chrome/content/zotero/xpcom/integration.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/chrome/content/zotero/xpcom/integration.js b/chrome/content/zotero/xpcom/integration.js index 02eab1599..a3f291c39 100644 --- a/chrome/content/zotero/xpcom/integration.js +++ b/chrome/content/zotero/xpcom/integration.js @@ -1437,12 +1437,17 @@ Zotero.Integration.Fields.prototype._processFields = function(fields, callback, Zotero.Integration.Fields.prototype.updateDocument = function(forceCitations, forceBibliography, ignoreCitationChanges, callback) { // update citations - this._session.updateUpdateIndices(forceCitations); - var me = this; - var deleteCitations = Zotero.pumpGenerator(this._session.updateCitations(function(deleteCitations) { - Zotero.pumpGenerator(me._updateDocument(forceCitations, forceBibliography, - ignoreCitationChanges, deleteCitations, callback)); - })); + try { + this._session.updateUpdateIndices(forceCitations); + var me = this; + var deleteCitations = Zotero.pumpGenerator(this._session.updateCitations(function(deleteCitations) { + Zotero.pumpGenerator(me._updateDocument(forceCitations, forceBibliography, + ignoreCitationChanges, deleteCitations, callback)); + })); + } catch(e) { + Zotero.logError(e); + Zotero.Integration.handleError(e, this._doc); + } } /** @@ -1786,7 +1791,7 @@ Zotero.Integration.CitationEditInterface.prototype = { me._fields.updateSession(function() { me._errorOccurred = false; me.accept(progressCallback, true); - }) + }); }, 0); return; }