MCPcopy Create free account
hub / github.com/freecodexyz/free-code / throwFault

Function throwFault

src/bridge/bridgeDebug.ts:96–110  ·  view source on GitHub ↗
(fault: BridgeFault, context: string)

Source from the content-addressed store, hash-verified

94 }
95
96 function throwFault(fault: BridgeFault, context: string): never {
97 logForDebugging(
98 `[bridge:debug] Injecting ${fault.kind} fault into ${context}: status=${fault.status} errorType=${fault.errorType ?? 'none'}`,
99 )
100 if (fault.kind === 'fatal') {
101 throw new BridgeFatalError(
102 `[injected] ${context} ${fault.status}`,
103 fault.status,
104 fault.errorType,
105 )
106 }
107 // Transient: mimic an axios rejection (5xx / network). No .status on
108 // the error itself — that's how the catch blocks distinguish.
109 throw new Error(`[injected transient] ${context} ${fault.status}`)
110 }
111
112 return {
113 ...api,

Callers 4

pollForWorkFunction · 0.85
reconnectSessionFunction · 0.85
heartbeatWorkFunction · 0.85

Calls 1

logForDebuggingFunction · 0.85

Tested by

no test coverage detected