From a8d0336cae775844fa3ee94bad7a735a6360bac9 Mon Sep 17 00:00:00 2001 From: Ajay Date: Fri, 24 Jun 2022 17:20:48 -0400 Subject: [PATCH] Don't crash on postgres errors --- src/databases/Postgres.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/databases/Postgres.ts b/src/databases/Postgres.ts index a6e855e..d34da78 100644 --- a/src/databases/Postgres.ts +++ b/src/databases/Postgres.ts @@ -21,6 +21,9 @@ export class Postgres implements IDatabase { async init(): Promise { this.pool = new Pool(this.config.postgres); + this.pool.on("error", (err) => { + Logger.error(err.stack); + }); if (!this.config.readOnly) { if (this.config.createDbIfNotExists) {