From 48536f5ec0737c0f5f23359dfcbec584ce9ecb1b Mon Sep 17 00:00:00 2001 From: Yotam Nachum Date: Fri, 3 Jan 2025 22:05:23 +0200 Subject: [PATCH] Try to log the exception message Since `lastKnownError` is typed as `any` we can't really be sure that `message` is properly set so I kept the fallback of trying to log the object itself. --- lib/common/lib/retrier.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/common/lib/retrier.ts b/lib/common/lib/retrier.ts index 588bff7d43..7ff3129f20 100644 --- a/lib/common/lib/retrier.ts +++ b/lib/common/lib/retrier.ts @@ -269,7 +269,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?.message ?? lastKnownError}\nRetrying request -> Total Attempts : ${waitContext.attemptCount}, Retrying after ${delayTime} seconds...` ); await delay(delayTime); GenericRetrier.refreshRequest(request);