refactor(llms): split AbortError out of InvokeError

This commit is contained in:
Simon
2026-06-03 23:00:33 +08:00
parent fb8de08c39
commit fd12fb9f1b
4 changed files with 6 additions and 14 deletions

View File

@@ -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