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

Function pgConstraintFromCause

packages/sql/pg/src/PgClient.ts:914–924  ·  view source on GitHub ↗
(cause: unknown)

Source from the content-addressed store, hash-verified

912}
913
914const pgConstraintFromCause = (cause: unknown): string => {
915 if (typeof cause !== "object" || cause === null || !("constraint" in cause)) {
916 return "unknown"
917 }
918 const constraint = cause.constraint
919 if (typeof constraint !== "string") {
920 return "unknown"
921 }
922 const normalized = constraint.trim()
923 return normalized.length === 0 ? "unknown" : normalized
924}
925
926const classifyError = (
927 cause: unknown,

Callers 1

classifyErrorFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected