From 662b06df8ef085fb78608ed19924383be62fa59f Mon Sep 17 00:00:00 2001 From: Johannes Schleifenbaum Date: Mon, 14 Jun 2021 18:56:02 +0200 Subject: [PATCH] catch errors and set non-zero exit code Signed-off-by: Johannes Schleifenbaum --- src/index.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 989545a..aa8e480 100644 --- a/src/index.ts +++ b/src/index.ts @@ -117,4 +117,7 @@ if (config.health.healthz.enabled) { const bot = new Mjolnir(client, protectedRooms, banLists); await bot.start(); -})(); +})().catch(err => { + logMessage(LogLevel.ERROR, "index", err); + process.exit(1); +});