fix report of translation failure in standalone

This commit is contained in:
Simon Kornblith 2011-01-10 21:41:01 +00:00
parent 255041556a
commit 3acdc18d88

View file

@ -664,11 +664,14 @@ Zotero.Translate.Base.prototype = {
Zotero.debug("Translate: WARNING: Zotero.done() called after translation completion; please fix your code");
return;
}
var oldState = this._currentState;
this._currentState = null;
this._waitForCompletion = false;
var errorString = null;
if(!returnValue) errorString = this._generateErrorString(error);
if(this._currentState === "detect") {
if(oldState === "detect") {
if(this._potentialTranslators.length) {
var lastTranslator = this._potentialTranslators.shift();
@ -708,8 +711,6 @@ Zotero.Translate.Base.prototype = {
this._runHandler("done", returnValue);
}
this._waitForCompletion = false;
this._currentState = null;
return errorString;
},