MCPcopy Create free account
hub / github.com/Effect-TS/effect / pgCodeFromCause

Function pgCodeFromCause

packages/sql/pglite/src/PgliteClient.ts:479–485  ·  view source on GitHub ↗
(cause: unknown)

Source from the content-addressed store, hash-verified

477const ATTR_DB_SYSTEM_NAME = "db.system.name"
478
479const pgCodeFromCause = (cause: unknown): string | undefined => {
480 if (typeof cause !== "object" || cause === null || !("code" in cause)) {
481 return undefined
482 }
483 const code = cause.code
484 return typeof code === "string" ? code : undefined
485}
486
487const pgConstraintFromCause = (cause: unknown): string => {
488 if (typeof cause !== "object" || cause === null || !("constraint" in cause)) {

Callers 1

classifyErrorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected