(msg: string)
| 823 | const logger = defaults.logger; |
| 824 | |
| 825 | const proxyError = (msg: string): void => { |
| 826 | logger.error(`OpenRouter video content proxy failed: ${msg}`); |
| 827 | // Guard BEFORE journaling (file convention): a disconnected client gets |
| 828 | // neither a write nor a journal entry. |
| 829 | if (res.destroyed || res.writableEnded) return; |
| 830 | journal.add({ |
| 831 | method, |
| 832 | path, |
| 833 | headers: flattenHeaders(req.headers), |
| 834 | body: null, |
| 835 | response: { |
| 836 | status: 502, |
| 837 | fixture: null, |
| 838 | source: "proxy", |
| 839 | ...strictOverrideField(defaults.strict, req.headers), |
| 840 | }, |
| 841 | }); |
| 842 | writeErrorResponse( |
| 843 | res, |
| 844 | 502, |
| 845 | JSON.stringify({ |
| 846 | error: { message: `Proxy to upstream failed: ${msg}`, type: "proxy_error" }, |
| 847 | }), |
| 848 | ); |
| 849 | }; |
| 850 | |
| 851 | // Recording can be disabled mid-flight (LLMock.disableRecording) — an |
| 852 | // orphaned record job must fail loudly BEFORE contacting the upstream |
no test coverage detected
searching dependent graphs…