Merge pull request #3203 from Infisical/misc/add-uncaught-exception-handler

misc: add uncaught exception handler
This commit is contained in:
Sheen
2025-03-08 00:36:08 +08:00
committed by GitHub

View File

@@ -83,6 +83,14 @@ const run = async () => {
process.exit(0);
});
process.on("uncaughtException", (error) => {
logger.error(error, "CRITICAL ERROR: Uncaught Exception");
});
process.on("unhandledRejection", (error) => {
logger.error(error, "CRITICAL ERROR: Unhandled Promise Rejection");
});
await server.listen({
port: envConfig.PORT,
host: envConfig.HOST,