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

Function driverCodesOf

apps/cloud/src/auth/errors.ts:69–83  ·  view source on GitHub ↗
(failure: unknown)

Source from the content-addressed store, hash-verified

67};
68
69const driverCodesOf = (failure: unknown): readonly string[] => {
70 const codes: string[] = [];
71 let current: unknown = isServiceAdapterError(failure) ? failure.cause : failure;
72 for (
73 let depth = 0;
74 depth < MAX_CAUSE_DEPTH && current !== undefined && current !== null;
75 depth++
76 ) {
77 const code = stringCodeOf(current);
78 if (code !== undefined) codes.push(code);
79 current =
80 typeof current === "object" ? (current as { readonly cause?: unknown }).cause : undefined;
81 }
82 return codes;
83};
84
85/** Classify a raw store failure. A recognised connection code wins; any other
86 * driver code (a SQLSTATE) is a deterministic query failure; nothing at all is

Callers 1

userStoreReasonFromCauseFunction · 0.85

Calls 2

stringCodeOfFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected