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

Function userStoreReasonFromCause

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

Source from the content-addressed store, hash-verified

86 * driver code (a SQLSTATE) is a deterministic query failure; nothing at all is
87 * `unknown`. */
88export const userStoreReasonFromCause = (failure: unknown): UserStoreFailureReason => {
89 const codes = driverCodesOf(failure);
90 for (const code of codes) {
91 const reason = REASON_BY_DRIVER_CODE[code];
92 if (reason !== undefined) return reason;
93 }
94 return codes.length > 0 ? "query" : "unknown";
95};
96
97/** Build the public `UserStoreError` for a store-adapter failure, naming the
98 * operation the call site already knows and classifying the driver cause. */

Callers 2

Calls 1

driverCodesOfFunction · 0.85

Tested by

no test coverage detected