Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upError object differs between pg and pg-native #938
Comments
Adding to the |
In the meantime, the generic error handler can simply accept the |
* Add client connectionString tests (#1310) * Remove redundant tests * Add client connectionString test Add test to ensure { connectionString } is respected as an argument to the client constructor * Add test for connection string property Also fixed some legacy require statements. * Normalize native error properties Map native error properties to the same property names we use for errors from the JS driver. Fixes #972 Fixes #938
I have this fixed on the 7.0 branch. |
* Add client connectionString tests (#1310) * Remove redundant tests * Add client connectionString test Add test to ensure { connectionString } is respected as an argument to the client constructor * Add test for connection string property Also fixed some legacy require statements. * Normalize native error properties Map native error properties to the same property names we use for errors from the JS driver. Fixes #972 Fixes #938
The fix for #743 made me test a switch to pg-native again. However, I still found an API difference: the Error object. While the default pg library returns an error with properties
code
anddetail
, the parameters are named differently when using pg-native.require('pg')
:require('pg').native
:This makes it hard to do proper error handling. Especially the
code
property is probably used a lot for that.