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

Function causeCode

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

Source from the content-addressed store, hash-verified

123
124/** First driver error code in the cause chain, if any. Never the error text. */
125const causeCode = (cause: unknown): string | undefined => {
126 let found: string | undefined;
127 walkCauses(cause, (err) => {
128 const code = err["code"];
129 if (typeof code === "string" && code.length > 0) {
130 found = code;
131 return true;
132 }
133 return false;
134 });
135 return found;
136};
137
138/** Connection-fault code in the cause chain, if this is a connection fault at all. */
139const connectionFaultCode = (cause: unknown): string | undefined => {

Callers 1

fumaFailureFromCauseFunction · 0.85

Calls 1

walkCausesFunction · 0.85

Tested by

no test coverage detected