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

Function parseError

cf/src/connection.js:1012–1022  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

1010}
1011
1012function parseError(x) {
1013 const error = {}
1014 let start = 5
1015 for (let i = 5; i < x.length - 1; i++) {
1016 if (x[i] === 0) {
1017 error[errorFields[x[start]]] = x.toString('utf8', start + 1, i)
1018 start = i + 1
1019 }
1020 }
1021 return error
1022}
1023
1024function md5(x) {
1025 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