MCPcopy Create free account
hub / github.com/effect-app/libs / sqlIsTransient

Function sqlIsTransient

packages/infra/src/Store/SQL.ts:22–23  ·  view source on GitHub ↗
(e: unknown)

Source from the content-addressed store, hash-verified

20
21const sqlErrorMessage = (e: unknown) => (e as any)?.message ? String((e as any).message) : String(e)
22const sqlIsTransient = (e: unknown) =>
23 /timeout|ETIMEDOUT|ECONNRESET|ECONNREFUSED|connection|deadlock|too many connections/i.test(sqlErrorMessage(e))
24// Map a SqlError into a typed, serializable DatabaseError (instead of `.orDie`,
25// which would turn it into an opaque, non-serializable defect).
26const toDatabaseError = (e: unknown) =>

Callers 1

toDatabaseErrorFunction · 0.85

Calls 1

sqlErrorMessageFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…