MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / isRetryableError

Function isRetryableError

cli/src/utils/codebuff-api.ts:248–267  ·  view source on GitHub ↗
(error: unknown)

Source from the content-addressed store, hash-verified

246 * (e.g., user cancelled the request or our timeout was exceeded).
247 */
248const isRetryableError = (error: unknown): boolean => {
249 if (error instanceof Error) {
250 const name = error.name.toLowerCase()
251 const message = error.message.toLowerCase()
252
253 // Don't retry abort errors - they indicate intentional cancellation
254 if (name === 'aborterror') {
255 return false
256 }
257
258 return (
259 name === 'timeouterror' ||
260 message.includes('network') ||
261 message.includes('fetch') ||
262 message.includes('econnreset') ||
263 message.includes('econnrefused')
264 )
265 }
266 return false
267}
268
269/**
270 * Create a Codebuff API client for making authenticated requests to the Codebuff API

Callers 1

requestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected