brianc / node-libpq

Simple, low level native bindings to PostgreSQL's libpq from node.js
112 stars 42 forks source link

Improve sync connection error message #9

Closed brianc closed 9 years ago

brianc commented 9 years ago

The connection pointer was being freed before accessing the error. This resulted in a 'connection pointer is NULL' error message being returned, making it hard to debug what was actually causing the issue. Now I read the error message before freeing the connection. :tada:

fixes https://github.com/brianc/node-pg-native/issues/13