(status, errorText)
| 185 | } |
| 186 | |
| 187 | function classifyFailure(status, errorText) { |
| 188 | const text = String(errorText || '').toLowerCase(); |
| 189 | if (status === 402 || text.includes('insufficient_credits')) return 'funds'; |
| 190 | if (status === 400 || status === 403 || status === 404) return 'permanent'; |
| 191 | return 'transient'; |
| 192 | } |
| 193 | |
| 194 | function parseShortfall(errorText) { |
| 195 | const match = String(errorText || '').match(/need\s+(\d+(?:\.\d+)?),\s*have\s+(\d+(?:\.\d+)?)/i); |
no outgoing calls
no test coverage detected