Skip to content

Commit 25bec58

Browse files
committed
Revert "chore: refactor connection kill"
This reverts commit 869dd06.
1 parent 869dd06 commit 25bec58

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/lib/db.ts

+1-6
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,7 @@ export const init: (config: PoolConfig) => {
115115
}
116116
return { data: res.rows, error: null }
117117
} catch (error: any) {
118-
if (
119-
error.constructor.name === 'DatabaseError' &&
120-
// If that's a global packet handling error it's raised as a "DatabaseError" but really is a
121-
// underlying parser error, we want to error to be treated as a connection error and end the pool
122-
!(error.message && error.message.startsWith('exception received while handling packet'))
123-
) {
118+
if (error.constructor.name === 'DatabaseError') {
124119
// Roughly based on:
125120
// - https://github.com/postgres/postgres/blob/fc4089f3c65a5f1b413a3299ba02b66a8e5e37d0/src/interfaces/libpq/fe-protocol3.c#L1018
126121
// - https://github.com/brianc/node-postgres/blob/b1a8947738ce0af004cb926f79829bb2abc64aa6/packages/pg/lib/native/query.js#L33

0 commit comments

Comments
 (0)