(error: unknown)
| 34 | * Standardized on statusCode === 402 for payment required detection. |
| 35 | */ |
| 36 | export const isOutOfCreditsError = (error: unknown): boolean => { |
| 37 | if ( |
| 38 | error && |
| 39 | typeof error === 'object' && |
| 40 | 'statusCode' in error && |
| 41 | (error as { statusCode: unknown }).statusCode === 402 |
| 42 | ) { |
| 43 | return true |
| 44 | } |
| 45 | return false |
| 46 | } |
| 47 | |
| 48 | /** |
| 49 | * Check if an error indicates free mode is not available in the user's country. |
no outgoing calls
no test coverage detected