Make sure updateDocument throws a visible error

This commit is contained in:
Simon Kornblith 2012-02-17 21:40:19 -05:00
parent 88edc08e78
commit 90d8363b0f

View File

@ -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;
}