Skip to content

Commit 57f5ac8

Browse files
authored
fix: do not retry 4xx status codes (#46)
1 parent 00b7194 commit 57f5ac8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

file_fetcher.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,10 @@ export async function fetchWithRetries(
328328
iterationCount++;
329329
try {
330330
const res = await fetch(url, init);
331-
if (res.ok || iterationCount > maxRetries) {
331+
if (
332+
res.ok || iterationCount > maxRetries ||
333+
res.status >= 400 && res.status < 500
334+
) {
332335
return res;
333336
}
334337
} catch (err) {

0 commit comments

Comments
 (0)