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

Function driverCodesOf

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

Source from the content-addressed store, hash-verified

88};
89
90const driverCodesOf = (failure: unknown): readonly string[] => {
91 const codes: string[] = [];
92 let current: unknown = isServiceAdapterError(failure) ? failure.cause : failure;
93 for (
94 let depth = 0;
95 depth < MAX_CAUSE_DEPTH && current !== undefined && current !== null;
96 depth++
97 ) {
98 const code = stringCodeOf(current);
99 if (code !== undefined) codes.push(code);
100 current =
101 typeof current === "object" ? (current as { readonly cause?: unknown }).cause : undefined;
102 }
103 return codes;
104};
105
106/** Classify a raw store failure. A recognised connection code wins; any other
107 * 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