MCPcopy Create free account
hub / github.com/CopilotKit/aimock / proxyError

Function proxyError

src/openrouter-video.ts:825–849  ·  view source on GitHub ↗
(msg: string)

Source from the content-addressed store, hash-verified

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

Calls 6

flattenHeadersFunction · 0.85
strictOverrideFieldFunction · 0.85
writeErrorResponseFunction · 0.85
errorMethod · 0.80
addMethod · 0.80
journalProxyFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…