Skip to content

Commit

Permalink
Prevent excessive error logging from child translators
Browse files Browse the repository at this point in the history
  • Loading branch information
adomasven committed Nov 30, 2022
1 parent ea1c83a commit c1cc3bd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/translation/translate.js
Original file line number Diff line number Diff line change
Expand Up @@ -1514,8 +1514,12 @@ Zotero.Translate.Base.prototype = {
this._debug("Translation successful");
} else {
if(error) {
// report error to console
Zotero.logError(error);
if (!this._parentTranslator) {
// store in error log if it's the root translator,
// otherwise it's up to the root translator whether it wants to
// log an error or not in this case
Zotero.logError(error);
}

// report error to debug log
this._debug("Translation using "+(this.translator && this.translator[0] && this.translator[0].label ? this.translator[0].label : "no translator")+" failed: \n"+errorString, 2);
Expand Down

0 comments on commit c1cc3bd

Please sign in to comment.