(error: unknown)
| 96 | * - other 4xx errors |
| 97 | */ |
| 98 | export function isRetryableConnectionError(error: unknown): boolean { |
| 99 | const { axiosCode, httpStatus } = extractErrorInfo(error) |
| 100 | |
| 101 | // Retryable network errors |
| 102 | if (axiosCode === 'ECONNREFUSED' || |
| 103 | axiosCode === 'ETIMEDOUT' || |
| 104 | axiosCode === 'ENOTFOUND' || |
| 105 | axiosCode === 'ENETUNREACH' || |
| 106 | axiosCode === 'ECONNRESET') { |
| 107 | return true |
| 108 | } |
| 109 | |
| 110 | // 5xx server errors are retryable |
| 111 | if (httpStatus && httpStatus >= 500) { |
| 112 | return true |
| 113 | } |
| 114 | |
| 115 | // Other errors (401, 403, 404, etc.) are not retryable |
| 116 | return false |
| 117 | } |
nothing calls this directly
no test coverage detected