Call complete() when no translators are set. Don't fail when a translator returns without throwing an error or completing an item.
This commit is contained in:
parent
435b1d7bd8
commit
4b09137402
1 changed files with 3 additions and 3 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue