MCPcopy Index your code
hub / github.com/simstudioai/sim / pgError

Function pgError

apps/realtime/src/database/preflight.test.ts:38–40  ·  view source on GitHub ↗

Builds a Postgres-shaped error carrying a SQLSTATE `code`, as postgres.js throws.

(code: string)

Source from the content-addressed store, hash-verified

36
37/** Builds a Postgres-shaped error carrying a SQLSTATE `code`, as postgres.js throws. */
38function pgError(code: string): Error & { code: string } {
39 return Object.assign(new Error(`pg error ${code}`), { code })
40}
41
42/** Mirrors how drizzle wraps the driver error: the SQLSTATE lives on `cause`, not the outer error. */
43function wrappedPgError(code: string): Error {

Callers 2

wrappedPgErrorFunction · 0.85
preflight.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected