refactor(llms): split AbortError out of InvokeError
This commit is contained in:
@@ -78,6 +78,7 @@ async function withRetry<T>(
|
||||
try {
|
||||
return await fn()
|
||||
} catch (error: unknown) {
|
||||
if ((error as any)?.name === 'AbortError') throw error
|
||||
if (error instanceof InvokeError && !error.retryable) throw error
|
||||
attempt++
|
||||
if (attempt > settings.maxRetries) throw error
|
||||
|
||||
Reference in New Issue
Block a user