Replace uncaughtException handler…

…with async exit hook uncaught exception handler which will make it exit after completing exit hooks.
This commit is contained in:
Lamp 2018-09-18 23:47:50 -07:00 committed by GitHub
parent 08da3241ff
commit cc7d6780e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -17,9 +17,10 @@ global.dClient = new Discord.Client({ disableEveryone: true });
} catch(e) {}
}
process.on('unhandledRejection', error => onError(error, "Unhandled Rejection"));
process.on('uncaughtException', error => onError(error, "Uncaught Exception"));
exitHook.uncaughtExceptionHandler(error => onError(error, "Uncaught Exception"));
dClient.on('error', error => onError(error, "Discord Client Error"));
dClient.on('warn', error => onError(error, "Discord Client Warning"));
}