Refactor isRateLimitError function for improved readability

This commit is contained in:
mahabaleshwars
2026-09-28 19:09:35 +05:30
parent e1612932b5
commit 9b1eb4576a
+1 -3
View File
@@ -275,9 +275,7 @@ function sleep(ms: number): Promise<void> {
// HTTP 403/429 from http-client (`statusCode`) or tool-cache (`httpStatusCode`).
function isRateLimitError(err: unknown): boolean {
const e = err as
| {httpStatusCode?: number; statusCode?: number}
| null
| undefined;
{httpStatusCode?: number; statusCode?: number} | null | undefined;
const status = e?.httpStatusCode ?? e?.statusCode;
return status === 403 || status === 429;
}