feat(app): handle unhandled exception & rejection

This commit is contained in:
ItzCrazyKns 2024-07-30 10:07:28 +05:30
parent 0a29237732
commit 9abb4b654d
No known key found for this signature in database
GPG Key ID: 8162927C7CCE3065
1 changed files with 8 additions and 0 deletions

View File

@ -28,3 +28,11 @@ server.listen(port, () => {
}); });
startWebSocketServer(server); startWebSocketServer(server);
process.on('uncaughtException', (err, origin) => {
logger.error(`Uncaught Exception at ${origin}: ${err}`)
})
process.on('unhandledRejection', (reason, promise) => {
logger.error(`Unhandled Rejection at: ${promise}, reason: ${reason}`)
})