From b43231b78ef1d943343a250185e88b70e0a0dde6 Mon Sep 17 00:00:00 2001 From: Alexander Onnikov Date: Thu, 4 Jan 2024 15:36:40 +0700 Subject: [PATCH] UBERF-4824 Handle unhandled rejections in collaborator (#4302) Signed-off-by: Alexander Onnikov --- server/collaborator/src/starter.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server/collaborator/src/starter.ts b/server/collaborator/src/starter.ts index 31c0df3ea6..87f2f2ea00 100644 --- a/server/collaborator/src/starter.ts +++ b/server/collaborator/src/starter.ts @@ -51,6 +51,14 @@ export async function startCollaborator (): Promise { void shutdown() } + process.on('uncaughtException', (e) => { + console.error(e) + }) + + process.on('unhandledRejection', (reason, promise) => { + console.error('Unhandled Rejection at:', promise, 'reason:', reason) + }) + process.on('SIGINT', close) process.on('SIGTERM', close) process.on('exit', close)