Builds a Postgres-shaped error carrying a SQLSTATE `code`, as postgres.js throws.
(code: string)
| 36 | |
| 37 | /** Builds a Postgres-shaped error carrying a SQLSTATE `code`, as postgres.js throws. */ |
| 38 | function 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. */ |
| 43 | function wrappedPgError(code: string): Error { |
no outgoing calls
no test coverage detected