mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-29 01:51:52 +08:00
Chore: housekeeping
This commit is contained in:
@@ -60,7 +60,8 @@ function createFetchRetry($fetch: typeof fetch): FetchWithRetry {
|
||||
retries: MAX_RETRIES,
|
||||
factor: FACTOR,
|
||||
maxRetryAfter: MAX_RETRY_AFTER,
|
||||
retryOnAborted: false
|
||||
retryOnAborted: false,
|
||||
retryOnNon2xx: true
|
||||
},
|
||||
opts.retry
|
||||
);
|
||||
@@ -85,6 +86,9 @@ function createFetchRetry($fetch: typeof fetch): FetchWithRetry {
|
||||
}
|
||||
throw new ResponseError(res);
|
||||
} else {
|
||||
if (!res.ok && retryOpts.retryOnNon2xx) {
|
||||
throw new ResponseError(res);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
} catch (err: unknown) {
|
||||
|
||||
Reference in New Issue
Block a user