MCPcopy Index your code
hub / github.com/codeaashu/claude-code / isTransientNetworkError

Function isTransientNetworkError

src/utils/teleport/api.ts:24–41  ·  view source on GitHub ↗
(error: unknown)

Source from the content-addressed store, hash-verified

22 * Checks if an axios error is a transient network error that should be retried
23 */
24export function isTransientNetworkError(error: unknown): boolean {
25 if (!axios.isAxiosError(error)) {
26 return false
27 }
28
29 // Retry on network errors (no response received)
30 if (!error.response) {
31 return true
32 }
33
34 // Retry on server errors (5xx)
35 if (error.response.status >= 500) {
36 return true
37 }
38
39 // Don't retry on client errors (4xx) - they're not transient
40 return false
41}
42
43/**
44 * Makes an axios GET request with automatic retry for transient network errors

Callers 2

axiosGetWithRetryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected