chore(fetcher): retry unexpected exceptions

This commit is contained in:
WebStreamr 2025-10-02 15:07:57 +00:00
parent 34b7fddfc7
commit 5ac359f1eb
No known key found for this signature in database

View file

@ -338,6 +338,13 @@ export class Fetcher {
throw new TimeoutError();
}
if (tryCount < 3) {
this.logger.warn(`Retrying fetch ${init?.method ?? 'GET'} ${url} because of an unexpected error`, ctx);
await this.sleep(333);
return await this.fetchWithTimeout(ctx, url, init, ++tryCount);
}
throw error;
}