commit 4b09137402ebbaa5ebfdb4ca26cfb704c5280211
parent 435b1d7bd80a88befdc0810b753eaa0211b77f49
Author: aurimasv <aurimas.dev@gmail.com>
Date: Fri, 23 Nov 2012 23:06:05 -0600
Call complete() when no translators are set. Don't fail when a translator returns without throwing an error or completing an item.
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/chrome/content/zotero/xpcom/translation/translate.js b/chrome/content/zotero/xpcom/translation/translate.js
@@ -1045,7 +1045,7 @@ Zotero.Translate.Base.prototype = {
this._currentState = "translate";
if(!this.translator || !this.translator.length) {
- throw new Error("Failed: no translator specified");
+ this.complete(false, new Error("No translator specified"));
}
this._libraryID = libraryID;
@@ -2093,8 +2093,8 @@ Zotero.Translate.Search.prototype.setTranslator = function(translator) {
*/
Zotero.Translate.Search.prototype.complete = function(returnValue, error) {
if(this._currentState == "translate" && (!this.newItems || !this.newItems.length)) {
- Zotero.debug("Translate: Could not find a result using "+this.translator[0].label+": \n"
- +this._generateErrorString(error), 3);
+ Zotero.debug("Translate: Could not find a result using "+this.translator[0].label, 3);
+ if(error) Zotero.debug(this._generateErrorString(error), 3);
if(this.translator.length > 1) {
this.translator.shift();
this.translate(this._libraryID, this._saveAttachments);