(err, fallbackStatus = 502)
| 62 | } |
| 63 | |
| 64 | function makeOpenAIGatewayError(err, fallbackStatus = 502) { |
| 65 | const name = err && err.name ? String(err.name) : ''; |
| 66 | const isTimeout = name === 'TimeoutError' || name === 'AbortError'; |
| 67 | const out = new Error(isTimeout ? 'openai upstream timed out' : 'openai upstream request failed'); |
| 68 | out.statusCode = isTimeout ? 504 : fallbackStatus; |
| 69 | out.cause = err; |
| 70 | return out; |
| 71 | } |
| 72 | |
| 73 | function makeGeminiGatewayError(err, fallbackStatus = 502) { |
| 74 | const name = err && err.name ? String(err.name) : ''; |
no outgoing calls
no test coverage detected