(error: unknown)
| 598 | // header for fast-mode rejection (e.g., x-fast-mode-rejected). String-matching |
| 599 | // the error message is fragile and will break if the API wording changes. |
| 600 | function isFastModeNotEnabledError(error: unknown): boolean { |
| 601 | if (!(error instanceof APIError)) { |
| 602 | return false |
| 603 | } |
| 604 | return ( |
| 605 | error.status === 400 && |
| 606 | (error.message?.includes('Fast mode is not enabled') ?? false) |
| 607 | ) |
| 608 | } |
| 609 | |
| 610 | export function is529Error(error: unknown): boolean { |
| 611 | if (!(error instanceof APIError)) { |