brianc / node-pg-types

Type parsing for node-postgres
268 stars 55 forks source link

Binary array unknown ElementType log vs Error #93

Closed sehrope closed 5 years ago

sehrope commented 5 years ago

While going through for adding linting I noticed the log line at 200: https://github.com/brianc/node-pg-types/blob/10f2725d6133cae1a09a52e1a09305747e66fb16/lib/binaryParsers.js#L188-L202

Should be a throw new Error(...) right? At the very least something should be returned as now it'd default to returning undefined.

bendrucker commented 5 years ago

Agreed, there's no reason why a library like this should be printing anything to std{out,err}

charmander commented 5 years ago

Yep! Although nothing throws explicitly so far, there are plenty of implicit throws, and silently giving the wrong result seems worse.