make handling of failure in _loadTranslator consistent

This commit is contained in:
Simon Kornblith 2011-07-06 13:37:18 +00:00
parent 75b354a67e
commit 8640bbf37b

View file

@ -936,10 +936,7 @@ Zotero.Translate.Base.prototype = {
*/
"_translateHaveTranslator":function() {
// load translators
if(!this._loadTranslator(this.translator[0])) {
this.complete(false, new Error("Translator could not be loaded"));
return;
}
if(!this._loadTranslator(this.translator[0])) return;
// set display options to default if they don't exist
if(!this._displayOptions) this._displayOptions = this.translator[0].displayOptions;
@ -1091,9 +1088,7 @@ Zotero.Translate.Base.prototype = {
return;
}
if(!this._loadTranslator(this._potentialTranslators[0])) {
this.complete(false);
}
if(!this._loadTranslator(this._potentialTranslators[0])) return
this._prepareDetection();
this.incrementAsyncProcesses();
@ -1545,6 +1540,7 @@ Zotero.Translate.Import.prototype._loadTranslator = function(translator) {
if(err) {
Zotero.debug("Translate: Preparing IO for "+translator.label+" failed: ");
Zotero.debug(err);
this.complete(false, err);
return false;
}