(err, fallbackStatus = 502)
| 71 | } |
| 72 | |
| 73 | function makeGeminiGatewayError(err, fallbackStatus = 502) { |
| 74 | const name = err && err.name ? String(err.name) : ''; |
| 75 | const isTimeout = name === 'TimeoutError' || name === 'AbortError'; |
| 76 | const out = new Error(isTimeout ? 'gemini upstream timed out' : 'gemini upstream request failed'); |
| 77 | out.statusCode = isTimeout ? 504 : fallbackStatus; |
| 78 | out.cause = err; |
| 79 | return out; |
| 80 | } |
| 81 | |
| 82 | function makeOllamaGatewayError(err, fallbackStatus = 502) { |
| 83 | const name = err && err.name ? String(err.name) : ''; |
no outgoing calls
no test coverage detected