Ensure error gets shown even if connection to word processor has died

This commit is contained in:
Simon Kornblith 2012-05-30 00:12:03 -04:00
parent 2c2c1c797a
commit f7f5d8b9d6

View file

@ -664,12 +664,20 @@ Zotero.Integration = new function() {
} }
if(displayError) { if(displayError) {
var showErrorInFirefox = !document;
if(document) { if(document) {
document.activate(); try {
document.displayAlert(displayError, document.activate();
Components.interfaces.zoteroIntegrationDocument.DIALOG_ICON_STOP, document.displayAlert(displayError,
Components.interfaces.zoteroIntegrationDocument.DIALOG_BUTTONS_OK); Components.interfaces.zoteroIntegrationDocument.DIALOG_ICON_STOP,
} else { Components.interfaces.zoteroIntegrationDocument.DIALOG_BUTTONS_OK);
} catch(e) {
showErrorInFirefox = true;
}
}
if(showErrorInFirefox) {
Zotero.Integration.activate(); Zotero.Integration.activate();
Components.classes["@mozilla.org/embedcomp/prompt-service;1"] Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
.getService(Components.interfaces.nsIPromptService) .getService(Components.interfaces.nsIPromptService)
@ -1544,7 +1552,6 @@ Zotero.Integration.Fields.prototype.updateDocument = function(forceCitations, fo
ignoreCitationChanges, deleteCitations, callback)); ignoreCitationChanges, deleteCitations, callback));
})); }));
} catch(e) { } catch(e) {
Zotero.logError(e);
Zotero.Integration.handleError(e, this._doc); Zotero.Integration.handleError(e, this._doc);
} }
} }