From 3335d541539bc1c88950f435800b9108311ed9f7 Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Tue, 28 Sep 2021 09:48:24 -0400 Subject: [PATCH] Log stack for unhandled errors --- src/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/index.ts b/src/index.ts index 8ffaafb..5c7787f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -6,6 +6,10 @@ import { startAllCrons } from "./cronjob"; import { getCommit } from "./utils/getCommit"; async function init() { + process.on("unhandledRejection", (error: any) => { + console.dir(error.stack); + }); + await initDb(); (global as any).HEADCOMMIT = config.mode === "development" ? "development" : config.mode === "test" ? "test"