From 94ad61a35ebe584a7e709416d29eaaf055ec762d Mon Sep 17 00:00:00 2001 From: jamesread Date: Mon, 16 Sep 2024 07:28:35 +0100 Subject: [PATCH] feat: Better startup and failure message for backend --- apps/backend/src/main.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/backend/src/main.ts b/apps/backend/src/main.ts index 6b0bd131e..7cc0a962e 100644 --- a/apps/backend/src/main.ts +++ b/apps/backend/src/main.ts @@ -35,8 +35,14 @@ async function bootstrap() { loadSwagger(app); const port = process.env.PORT || 3000; - await app.listen(port); - Logger.log(`🚀 Application is running on: http://localhost:${port}`); + + try { + await app.listen(port); + + Logger.log(`🚀 Backend is running on: http://localhost:${port}`); + } catch (e) { + Logger.error(`Backend failed to start on port ${port}`, e); + } } bootstrap();