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

Function causeCode

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

Source from the content-addressed store, hash-verified

142
143/** First driver error code in the cause chain, if any. Never the error text. */
144const causeCode = (cause: unknown): string | undefined => {
145 let found: string | undefined;
146 walkCauses(cause, (err) => {
147 const code = err["code"];
148 if (typeof code === "string" && code.length > 0) {
149 found = code;
150 return true;
151 }
152 return false;
153 });
154 return found;
155};
156
157/** Connection-fault code in the cause chain, if this is a connection fault at all. */
158const connectionFaultCode = (cause: unknown): string | undefined => {

Callers 1

fumaFailureFromCauseFunction · 0.85

Calls 1

walkCausesFunction · 0.85

Tested by

no test coverage detected