(error: unknown)
| 194 | } |
| 195 | |
| 196 | export function isLegacyFallbackError(error: unknown): boolean { |
| 197 | const axiosError = error as { |
| 198 | response?: { status?: number; data?: { message?: string } | string }; |
| 199 | message?: string; |
| 200 | }; |
| 201 | if (axiosError.response?.status === 404) { |
| 202 | return true; |
| 203 | } |
| 204 | |
| 205 | const data = axiosError.response?.data; |
| 206 | const message = |
| 207 | typeof data === 'string' ? data : data?.message || axiosError.message || ''; |
| 208 | return message.toLowerCase().includes('missing api key'); |
| 209 | } |
| 210 | |
| 211 | function withLegacyFallback<T>( |
| 212 | primary: Promise<unknown>, |
no outgoing calls
no test coverage detected