www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 8640bbf37b9b48f3670b823928ed18fe4a40e26a
parent 75b354a67ec8774b6c9b2c4fe33b748e51f9ac5c
Author: Simon Kornblith <simon@simonster.com>
Date:   Wed,  6 Jul 2011 13:37:18 +0000

make handling of failure in _loadTranslator consistent


Diffstat:
Mchrome/content/zotero/xpcom/translation/translate.js | 10+++-------
1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/chrome/content/zotero/xpcom/translation/translate.js b/chrome/content/zotero/xpcom/translation/translate.js @@ -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; }