MCPcopy Create free account
hub / github.com/continuedev/continue / isRetryableError

Function isRetryableError

extensions/cli/src/util/exponentialBackoff.ts:117–145  ·  view source on GitHub ↗

* Determines if an error is retryable based on the error type and status code

(error: any)

Source from the content-addressed store, hash-verified

115 * Determines if an error is retryable based on the error type and status code
116 */
117function isRetryableError(error: any): boolean {
118 // Context length errors are never retryable - they need user intervention
119 if (isContextLengthError(error)) {
120 return false;
121 }
122
123 // Network errors are retryable
124 if (isNetworkError(error)) {
125 return true;
126 }
127
128 // HTTP status codes that are retryable
129 if (error.status && isRetryableHttpStatus(error.status)) {
130 return true;
131 }
132
133 // OpenAI/API specific errors
134 if (isServerError(error)) {
135 return true;
136 }
137
138 // Check for connection issues by message content
139 const errorMessage = error.message?.toLowerCase();
140 if (errorMessage && isConnectionError(errorMessage)) {
141 return true;
142 }
143
144 return false;
145}
146
147/**
148 * Calculates the delay for the next retry attempt

Callers 2

withExponentialBackoffFunction · 0.70

Calls 5

isContextLengthErrorFunction · 0.85
isNetworkErrorFunction · 0.85
isRetryableHttpStatusFunction · 0.85
isServerErrorFunction · 0.85
isConnectionErrorFunction · 0.85

Tested by

no test coverage detected