Standardizing on a single error type
See original GitHub issueHi Brian - we just got bit by https://github.com/brianc/node-postgres/issues/938 and I am hoping to fix the issue.
Per your comment here:
This is probably something that should be normalized within node-postgres itself rather than here in the native lib. If you wanna take a crack at it over there I’ll happily review the PR!
It sounds like your proposed solution is to keep the node-postgres
error API consistent, and transform error objects coming from pg-native
, instead of:
- changing the error objects here to match the ones in the pg-native library
- changing the error objects in pg-native to match the error here.
does that sound right? i’ll start working on a patch.
Issue Analytics
- State:
- Created 7 years ago
- Comments:12 (11 by maintainers)
Top Results From Across the Web
The Case for Standardized Error Handling in Your Web ...
I'm making the case for standardizing error handling from APIs so we can all stop ... The error response MUST be a single...
Read more >When and why to standardize a variable - ListenData
This tutorial explains when, why and how to standardize a variable in statistical modeling. Variable Standardization is one of the most important concept...
Read more >Standardization - Dimewiki - World Bank
Standardizations is not an abstract concept difficult to have an intuition for, but there are very large sources of errors if bad practices...
Read more >Process standardization and error reduction: A revisit from a ...
Standardization can, on the one hand, weaken the employees' choice by guiding them to operate uniformly and follow instructions in order not to...
Read more >When Do You Need to Standardize the Variables in a ...
Yes, standardizing the variables can change the p-values. There's one prime reason I can think of off the top of my head–structural multicollinearity....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Got bitten by this peculiarity today after replacing
require('pg')
withrequire('pg').native
. I had had some error handlers that checked theerror.code
property for known values, because the code expected some tables to already exist and treated a failedCREATE TABLE
like a nominal case, but only for specified error codes (“SQL states”).Now I place
error.code === '42P07' || error.sqlState === '42P07'
in my handlers…I have this fixed on the 7.0 branch. Fix will be released in 7.0.