Skip to content

Commit 33e8249

Browse files
authored
fix(pg-pool): preserve original error on connection timeout, don't throw on readonly .message e.g. ErrorEvent
Fixes #3373
1 parent f10f569 commit 33e8249

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/pg-pool/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ class Pool extends EventEmitter {
244244
// remove the dead client from our list of clients
245245
this._clients = this._clients.filter((c) => c !== client)
246246
if (timeoutHit) {
247-
err.message = 'Connection terminated due to connection timeout'
247+
err = new Error('Connection terminated due to connection timeout', { cause: err } )
248248
}
249249

250250
// this client won’t be released, so move on immediately

0 commit comments

Comments
 (0)