* Checks if the error message indicates insufficient credits
(message: string)
| 102 | * Checks if the error message indicates insufficient credits |
| 103 | */ |
| 104 | function isInsufficientCreditsMessage(message: string): boolean { |
| 105 | const lowerMessage = message.toLowerCase(); |
| 106 | return ( |
| 107 | lowerMessage.includes('insufficient') || |
| 108 | lowerMessage.includes('credit') || |
| 109 | lowerMessage.includes('quota') || |
| 110 | lowerMessage.includes('balance too low') || |
| 111 | lowerMessage.includes('billing') || |
| 112 | lowerMessage.includes('payment required') || |
| 113 | lowerMessage.includes('exceeded') |
| 114 | ); |
| 115 | } |
| 116 | |
| 117 | /** |
| 118 | * Normalizes raw API errors into typed error classes. |
no test coverage detected
searching dependent graphs…