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

Function userStoreReasonFromCause

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

Source from the content-addressed store, hash-verified

107 * driver code (a SQLSTATE) is a deterministic query failure; nothing at all is
108 * `unknown`. */
109export const userStoreReasonFromCause = (failure: unknown): UserStoreFailureReason => {
110 const codes = driverCodesOf(failure);
111 for (const code of codes) {
112 const reason = REASON_BY_DRIVER_CODE[code];
113 if (reason !== undefined) return reason;
114 }
115 return codes.length > 0 ? "query" : "unknown";
116};
117
118/** Build the public `UserStoreError` for a store-adapter failure, naming the
119 * operation the call site already knows and classifying the driver cause. */

Callers 3

runFunction · 0.90

Calls 1

driverCodesOfFunction · 0.85

Tested by

no test coverage detected