Skip to content

Commit

Permalink
Use more helpful pool-lacking-error-handlers errors
Browse files Browse the repository at this point in the history
  • Loading branch information
benjie committed Nov 22, 2024
1 parent bcf9a87 commit cef1de1
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,17 @@ export async function assertPool(
pgPool = _rawOptions.pgPool;
if (pgPool.listeners("error").length === 0) {
console.warn(
`Your pool doesn't have error handlers! See: https://err.red/wpeh`,
`Your pool doesn't have error handlers! See: https://err.red/wpeh?v=${encodeURIComponent(
version,
)}`,
);
installErrorHandlers(compiledSharedOptions, releasers, pgPool);
}
if (pgPool.listeners("connect").length === 0) {
console.warn(
`Your pool doesn't have all of the error handlers! See: https://err.red/wpeh?v=${encodeURIComponent(
version,
)}&method=connect`,
);
installErrorHandlers(compiledSharedOptions, releasers, pgPool);
}
Expand Down

0 comments on commit cef1de1

Please sign in to comment.