Skip to content

Commit e06ff22

Browse files
committed
fix: isStatusCodeRetryable return early for NaN valuse
1 parent e987e36 commit e06ff22

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

nodes/Apify/resources/genericFunctions.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ export async function apiRequest(
8585
* because the error is probably caused by invalid URL (redirect 3xx) or invalid user input (4xx).
8686
*/
8787
function isStatusCodeRetryable(statusCode: number) {
88+
if (Number.isNaN(statusCode))
89+
return false;
90+
8891
const RATE_LIMIT_EXCEEDED_STATUS_CODE = 429;
8992
const isRateLimitError = statusCode === RATE_LIMIT_EXCEEDED_STATUS_CODE;
9093
const isInternalError = statusCode >= 500;

0 commit comments

Comments
 (0)