(error: unknown)
| 641 | // header for fast-mode rejection (e.g., x-fast-mode-rejected). String-matching |
| 642 | // the error message is fragile and will break if the API wording changes. |
| 643 | function isFastModeNotEnabledError(error: unknown): boolean { |
| 644 | if (!(error instanceof APIError)) { |
| 645 | return false |
| 646 | } |
| 647 | return ( |
| 648 | error.status === 400 && |
| 649 | (error.message?.includes('Fast mode is not enabled') ?? false) |
| 650 | ) |
| 651 | } |
| 652 | |
| 653 | export function is529Error(error: unknown): boolean { |
| 654 | if (!(error instanceof APIError)) { |