Remove other logging and just keep listening and try catch

This commit is contained in:
Ola Hungerford
2025-01-26 20:24:59 -07:00
parent 5b884b55b5
commit df955cfdb5

View File

@@ -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);