From c1cc3bd89014a81725437219c2376f32e50f87f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adomas=20Ven=C4=8Dkauskas?= Date: Wed, 30 Nov 2022 15:27:22 +0200 Subject: [PATCH] Prevent excessive error logging from child translators --- src/translation/translate.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/translation/translate.js b/src/translation/translate.js index 09c694b..ba69688 100644 --- a/src/translation/translate.js +++ b/src/translation/translate.js @@ -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);