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

Function causeCode

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

Source from the content-addressed store, hash-verified

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

Callers 1

fumaFailureFromCauseFunction · 0.85

Calls 1

walkCausesFunction · 0.85

Tested by

no test coverage detected