From cbf352173ad44b0cd55ee68feac67fa3269f46c8 Mon Sep 17 00:00:00 2001 From: Ajay Date: Thu, 25 Aug 2022 21:14:25 -0400 Subject: [PATCH] throw error if query fails --- src/databases/Postgres.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/databases/Postgres.ts b/src/databases/Postgres.ts index 35d9eaa..ff97c6f 100644 --- a/src/databases/Postgres.ts +++ b/src/databases/Postgres.ts @@ -141,6 +141,8 @@ export class Postgres implements IDatabase { } } while (this.isReadQuery(type) && tries < (lastPool === this.pool ? this.config.postgres.maxTries : this.config.postgresReadOnly.maxTries)); + + throw new Error(`prepare (postgres): ${type} ${query} failed after ${tries} tries`); } private getPool(type: string, options: QueryOption): Pool {