mirror of
https://github.com/fosrl/pangolin.git
synced 2025-07-31 08:04:54 +02:00
catch all uncaught errors in winston
This commit is contained in:
parent
9c40d8a5c7
commit
ac6a6d7616
1 changed files with 9 additions and 0 deletions
|
@ -72,4 +72,13 @@ const logger = winston.createLogger({
|
|||
transports,
|
||||
});
|
||||
|
||||
process.on("uncaughtException", (error) => {
|
||||
logger.error("Uncaught Exception:", { error, stack: error.stack });
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
process.on("unhandledRejection", (reason, _) => {
|
||||
logger.error("Unhandled Rejection:", { reason });
|
||||
});
|
||||
|
||||
export default logger;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue