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

Function pgCodeFromCause

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

Source from the content-addressed store, hash-verified

904const ATTR_SERVER_PORT = "server.port"
905
906const pgCodeFromCause = (cause: unknown): string | undefined => {
907 if (typeof cause !== "object" || cause === null || !("code" in cause)) {
908 return undefined
909 }
910 const code = cause.code
911 return typeof code === "string" ? code : undefined
912}
913
914const pgConstraintFromCause = (cause: unknown): string => {
915 if (typeof cause !== "object" || cause === null || !("constraint" in cause)) {

Callers 1

classifyErrorFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected