Created
December 9, 2025 00:05
-
-
Save chalkygames123/b00f1b526d87129abab020e04eb13750 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const RETRYABLE_HTTP_STATUS_CODES = new Set([ | |
| 408, 425, 429, 500, 502, 503, 504, | |
| ]); | |
| /** | |
| * Determines whether the HTTP response status code indicates a transient error that can be retried. | |
| * | |
| * @returns Whether the status code indicates a transient error. | |
| */ | |
| export const isRetryableHttpStatusCode = (code: number): boolean => { | |
| if (!Number.isInteger(code)) { | |
| return false; | |
| } | |
| return RETRYABLE_HTTP_STATUS_CODES.has(code); | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment