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

Function classifyFields

packages/sql/pg/src/PgConnection.ts:2707–2714  ·  view source on GitHub ↗
(
  fields: PgProtocol.ErrorFields,
  message: string,
  operation: string
)

Source from the content-addressed store, hash-verified

2705const ignoreError = (_: Error) => {}
2706
2707const classifyFields = (
2708 fields: PgProtocol.ErrorFields,
2709 message: string,
2710 operation: string
2711): SqlErrorReason => {
2712 const cause = Object.assign(new Error(fields.message ?? "Unknown PostgreSQL error"), fields)
2713 return classifySqlState(fields.code, fields.constraint, { cause, message, operation })
2714}

Callers 4

PgConnectionImplClass · 0.85
onMessageMethod · 0.85
onMessageFunction · 0.85
failErrorResponseFunction · 0.85

Calls 2

classifySqlStateFunction · 0.90
assignMethod · 0.80

Tested by

no test coverage detected