mirror of
https://github.com/snobu/destreamer.git
synced 2026-01-21 15:32:16 +00:00
process.exit on uncaught exceptions
This commit is contained in:
@@ -24,6 +24,11 @@ export function setProcessEvents(): void {
|
||||
process.exit(777);
|
||||
});
|
||||
|
||||
process.on('uncaughtException', (err: Error) => {
|
||||
logger.error(err);
|
||||
process.exit(ERROR_CODE.UNHANDLED_ERROR);
|
||||
});
|
||||
|
||||
process.on('unhandledRejection', (reason: {} | null | undefined) => {
|
||||
if (reason instanceof Error) {
|
||||
logger.error({ message: (reason as Error) });
|
||||
|
||||
Reference in New Issue
Block a user