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

Function pgCodeFromCause

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

Source from the content-addressed store, hash-verified

451const ATTR_DB_SYSTEM_NAME = "db.system.name"
452
453const pgCodeFromCause = (cause: unknown): string | undefined => {
454 if (typeof cause !== "object" || cause === null || !("code" in cause)) {
455 return undefined
456 }
457 const code = cause.code
458 return typeof code === "string" ? code : undefined
459}
460
461const pgConstraintFromCause = (cause: unknown): string => {
462 if (typeof cause !== "object" || cause === null || !("constraint" in cause)) {

Callers 1

classifyErrorFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected