commit 90d8363b0f15cbdc77abece581608b77bb4bbf12
parent 88edc08e78d703151405d43ac181b16d62d54237
Author: Simon Kornblith <simon@simonster.com>
Date: Fri, 17 Feb 2012 21:40:19 -0500
Make sure updateDocument throws a visible error
Diffstat:
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git 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;
}