From 55ea4ab3be46858acb772b3852971d2793d01e10 Mon Sep 17 00:00:00 2001 From: Liron Sher Date: Fri, 18 Oct 2024 16:29:36 +0300 Subject: [PATCH] fix error logging and custom retry this fix the logging issue where developer cannot see the real error reason --- lib/common/lib/retrier.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/common/lib/retrier.ts b/lib/common/lib/retrier.ts index 1f106e70c6..d2406c39e2 100644 --- a/lib/common/lib/retrier.ts +++ b/lib/common/lib/retrier.ts @@ -243,7 +243,7 @@ export class GenericRetrier { requestEndpoint: endpoint, troubleshootingPage: `See ${TROUBLESHOOT_URL} for help troubleshooting this error, or contact support and provide this full error message.` }; - shouldBeRetried = true; + shouldBeRetried = this.retryConfiguration.retryCondition(errorObject); } let currentTime = new Date().getTime(); let timeElapsed = currentTime - timestamp.getTime(); @@ -268,7 +268,7 @@ export class GenericRetrier { const delayTime = this.retryConfiguration.delayStrategy.delay(waitContext); waitContext.attemptCount++; console.warn( - `Request failed with Exception : ${lastKnownError}\nRetrying request -> Total Attempts : ${waitContext.attemptCount}, Retrying after ${delayTime} seconds...` + `Request failed with Exception : ${lastKnownError}\nRetrying request -> Total Attempts : ${waitContext.attemptCount}, Retrying after ${delayTime} seconds...`,lastKnownError ); await delay(delayTime); GenericRetrier.refreshRequest(request);