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

Function pgConstraintFromCause

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

Source from the content-addressed store, hash-verified

459}
460
461const pgConstraintFromCause = (cause: unknown): string => {
462 if (typeof cause !== "object" || cause === null || !("constraint" in cause)) {
463 return "unknown"
464 }
465 const constraint = cause.constraint
466 if (typeof constraint !== "string") {
467 return "unknown"
468 }
469 const normalized = constraint.trim()
470 return normalized.length === 0 ? "unknown" : normalized
471}
472
473const classifyError = (
474 cause: unknown,

Callers 1

classifyErrorFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected