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

Function connectionFaultCode

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

Source from the content-addressed store, hash-verified

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