Repository navigation
Handle client errors in pool.query - #131
Conversation
If an error not related to the query occurs, the client is emitting an error event. Forward this event to the callback.
130eb06 to
ba3910f
Compare
| }) | ||
|
|
||
| setTimeout(() => { | ||
| pool._clients[0].end() |
There was a problem hiding this comment.
to avoid the double error one could trigger the error directly pool._clients[0].connection.stream.emit('error', new Error())
|
Any news on that PR ? If an error occurs (eg. "Connection terminated unexpectedly"), we're unable to catch the error which lead to uncaughtException. |
|
This PR will resolve a ugly problem on our servers on kubernetes cluster. Sometimes a read only replica pod will be delete per kube orchestrator. We listen the What do you need to merge/release this fix ? |
|
I'm fine with the change. I just mentioned that test could be simpler. Either way @brianc has to approve it, I'm just an invested bystander. |
|
All check are green. Someone can merge/release this PR ? |
|
yup can merge & release. I'm moving this repo back into the main pg repo so I can better track all issue in one place soon too. |
If an error not related to the query occurs, the client is emitting an error event.
Forward this event to the callback.
Fixes #123 (comment)