MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / connectionFaultCode

Function connectionFaultCode

packages/core/sdk/src/fuma-runtime.ts:158–178  ·  view source on GitHub ↗
(cause: unknown)

Source from the content-addressed store, hash-verified

156
157/** Connection-fault code in the cause chain, if this is a connection fault at all. */
158const connectionFaultCode = (cause: unknown): string | undefined => {
159 let found: string | undefined;
160 walkCauses(cause, (err) => {
161 const code = err["code"];
162 if (
163 typeof code === "string" &&
164 (RETRYABLE_CONNECTION_CODES.has(code) || FATAL_CONNECTION_CODES.has(code))
165 ) {
166 found = code;
167 return true;
168 }
169 // oxlint-disable-next-line executor/no-unknown-error-message -- boundary: workerd's cross-request I/O rejection carries no code, only this fixed message
170 const message = err["message"];
171 if (typeof message === "string" && CROSS_REQUEST_IO_PATTERN.test(message)) {
172 found = CROSS_REQUEST_IO_CODE;
173 return true;
174 }
175 return false;
176 });
177 return found;
178};
179
180/**
181 * Build the failure message from stable inputs only — the call-site label and

Callers 1

fumaFailureFromCauseFunction · 0.85

Calls 1

walkCausesFunction · 0.85

Tested by

no test coverage detected