MCPcopy Create free account
hub / github.com/porsager/postgres / parseError

Function parseError

cjs/src/connection.js:1010–1020  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

1008}
1009
1010function parseError(x) {
1011 const error = {}
1012 let start = 5
1013 for (let i = 5; i < x.length - 1; i++) {
1014 if (x[i] === 0) {
1015 error[errorFields[x[start]]] = x.toString('utf8', start + 1, i)
1016 start = i + 1
1017 }
1018 }
1019 return error
1020}
1021
1022function md5(x) {
1023 return crypto.createHash('md5').update(x).digest('hex')

Callers 2

ErrorResponseFunction · 0.70
NoticeResponseFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected