From df955cfdb555f61f3857242b28a0a345c18ceacc Mon Sep 17 00:00:00 2001 From: Ola Hungerford Date: Sun, 26 Jan 2025 20:24:59 -0700 Subject: [PATCH] Remove other logging and just keep listening and try catch --- server/src/index.ts | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/server/src/index.ts b/server/src/index.ts index 0e1f2f7..6a131f7 100644 --- a/server/src/index.ts +++ b/server/src/index.ts @@ -161,26 +161,7 @@ try { const port = typeof addr === 'string' ? addr : addr?.port; console.log(`Server listening on port ${port}`); }); - - server.on('error', (error: any) => { - if (error.code === 'EADDRINUSE') { - console.error(`Port ${PORT} is already in use`); - process.exit(1); - } else { - console.error('Error starting server:', error); - process.exit(1); - } - }); - process.on('uncaughtException', (error) => { - console.error('Uncaught exception:', error); - process.exit(1); - }); - - process.on('unhandledRejection', (error) => { - console.error('Unhandled rejection:', error); - process.exit(1); - }); } catch (error) { console.error('Failed to start server:', error); process.exit(1);