From c47f48c64bf89f91d5ed0b8d2a25b1665733c82d Mon Sep 17 00:00:00 2001 From: WebStreamr <210764791+webstreamr@users.noreply.github.com> Date: Mon, 1 Sep 2025 08:17:59 +0000 Subject: [PATCH] chore(fetcher): log retries --- src/utils/Fetcher.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/utils/Fetcher.ts b/src/utils/Fetcher.ts index 09d4414..499c83a 100644 --- a/src/utils/Fetcher.ts +++ b/src/utils/Fetcher.ts @@ -272,6 +272,7 @@ export class Fetcher { } catch (error) { if (error instanceof DOMException && error.name === 'TimeoutError') { if (tryCount < 1) { + this.logger.warn(`Retrying fetch ${init?.method ?? 'GET'} ${url} because of timeout`, ctx); await new Promise(sleep => setTimeout(sleep, 333)); return await this.fetchWithTimeout(ctx, url, init, ++tryCount); @@ -287,6 +288,7 @@ export class Fetcher { await this.decreaseTimeoutsCount(url); if (response.status >= 500 && tryCount < 3) { + this.logger.warn(`Retrying fetch ${init?.method ?? 'GET'} ${url} because of error`, ctx); await new Promise(sleep => setTimeout(sleep, 333)); return await this.fetchWithTimeout(ctx, url, init, ++tryCount);