From 73d41ad31a9db61ca8185236405ed1ca75b02933 Mon Sep 17 00:00:00 2001 From: Harsh Patel Date: Sat, 10 Feb 2024 13:59:48 +0530 Subject: [PATCH] chore: add error handling --- apps/api/src/main.ts | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/apps/api/src/main.ts b/apps/api/src/main.ts index 4de34a31..17587211 100644 --- a/apps/api/src/main.ts +++ b/apps/api/src/main.ts @@ -92,16 +92,20 @@ async function initializeNestApp() { } async function bootstrap() { - await initializeSentry() - await Sentry.startSpan( - { - op: 'applicationBootstrap', - name: 'Application Bootstrap Process' - }, - async () => { - await initializeNestApp() - } - ) + try { + await initializeSentry() + await Sentry.startSpan( + { + op: 'applicationBootstrap', + name: 'Application Bootstrap Process' + }, + async () => { + await initializeNestApp() + } + ) + } catch (error) { + Sentry.captureException(error) + } } bootstrap()