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

Function decodeErrorFields

packages/sql/pg/src/PgProtocol.ts:1790–1799  ·  view source on GitHub ↗
(reader: Reader)

Source from the content-addressed store, hash-verified

1788}
1789
1790const decodeErrorFields = (reader: Reader): ErrorFields => {
1791 const fields: Record<string, string> = {}
1792 for (;;) {
1793 const code = reader.uint8()
1794 if (code === 0) break
1795 const key = String.fromCharCode(code)
1796 fields[errorFieldNames[key] ?? key] = reader.cString()
1797 }
1798 return fields
1799}
1800
1801const requireNonNegativeCount = (count: number, name: string): number => {
1802 if (count < 0) {

Callers 1

decodeBackendFunction · 0.85

Calls 2

uint8Method · 0.45
cStringMethod · 0.45

Tested by

no test coverage detected