(signal: { aborted: boolean })
| 422 | } |
| 423 | |
| 424 | async function callWithFallback(signal: { aborted: boolean }): Promise<PromptResult<string>> { |
| 425 | try { |
| 426 | const result = await primaryProvider(signal) |
| 427 | // If aborted, don't try fallback |
| 428 | if (result.aborted) { |
| 429 | return result |
| 430 | } |
| 431 | return result |
| 432 | } catch (error) { |
| 433 | // Don't fall back on abort errors |
| 434 | if (isAbortError(error)) { |
| 435 | throw error |
| 436 | } |
| 437 | // Try fallback for other errors |
| 438 | return fallbackProvider(signal) |
| 439 | } |
| 440 | } |
| 441 | |
| 442 | it('uses fallback on non-abort error', async () => { |
| 443 | const signal = { aborted: false } |
no test coverage detected