mirror of
https://github.com/brianc/node-postgres.git
synced 2025-12-08 20:16:25 +00:00
fix(pg-pool): don't throw on readonly .message e.g. ErrorEvent, preserve original exception (#3374)
* fix(pg-pool): preserve original error on connection timeout, don't throw on readonly .message e.g. ErrorEvent Fixes https://github.com/brianc/node-postgres/issues/3373 * Fix lint
This commit is contained in:
parent
751e7410d9
commit
95bec690b3
@ -244,7 +244,7 @@ class Pool extends EventEmitter {
|
||||
// remove the dead client from our list of clients
|
||||
this._clients = this._clients.filter((c) => c !== client)
|
||||
if (timeoutHit) {
|
||||
err.message = 'Connection terminated due to connection timeout'
|
||||
err = new Error('Connection terminated due to connection timeout', { cause: err })
|
||||
}
|
||||
|
||||
// this client won’t be released, so move on immediately
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user