Skip to content

Commit

Permalink
log pg client errors
Browse files Browse the repository at this point in the history
  • Loading branch information
boudra committed Apr 24, 2024
1 parent 806ce4a commit fa55a2b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ function createPgPool(args: { url: string; logger: Logger }): pg.Pool {
args.logger.error({ err, url: args.url }, "Postgres pool error");
});

pool.on("connect", (client) => {
client.on("error", (err) => {
args.logger.error({ err, url: args.url }, "Postgres client error");
});
});

return pool;
}

Expand Down

0 comments on commit fa55a2b

Please sign in to comment.