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