From c851c6a1819e108ffcb35ddc43013bf663fe2590 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Elizondo?= Date: Wed, 6 Nov 2024 09:10:14 -0600 Subject: [PATCH] Throw exception when DB connection fails --- src/index.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 4557d0f9..bcb76579 100644 --- a/src/index.ts +++ b/src/index.ts @@ -126,7 +126,10 @@ createConnection(ormConfig as ConnectionOptions) } } }) - .catch((error) => logger.error(error)); + .catch((error) => { + logger.fatal(error); + process.exit(); + }); async function schedule(connection: Connection | null, producer: Producer | null, func: any, funcName: string) { const start = new Date().getTime();