mirror of
https://github.com/actions/setup-python.git
synced 2026-07-18 06:19:58 +08:00
Refactor error handling in isRateLimitError function for improved clarity
This commit is contained in:
parent
9737be46d4
commit
0bc3767d34
3 changed files with 8 additions and 12 deletions
4
dist/setup/index.js
vendored
4
dist/setup/index.js
vendored
|
|
@ -55725,8 +55725,8 @@ function sleep(ms) {
|
|||
}
|
||||
// HTTP 403/429 from http-client (`statusCode`) or tool-cache (`httpStatusCode`).
|
||||
function isRateLimitError(err) {
|
||||
const status = err.httpStatusCode ??
|
||||
err.statusCode;
|
||||
const e = err;
|
||||
const status = e?.httpStatusCode ?? e?.statusCode;
|
||||
return status === 403 || status === 429;
|
||||
}
|
||||
// Fetches and validates a manifest, retrying transient failures with backoff.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue