Add error logs

This commit is contained in:
Christopher Cookman 2024-06-24 12:55:54 -06:00
parent 061919cac5
commit b725d9b662
Signed by: ChrisChrome
GPG key ID: A023A26E42C33A42

View file

@ -261,5 +261,14 @@ client.on('interactionCreate', async interaction => {
}
});
// Handle unhandled rejections and exceptions
process.on('unhandledRejection', error => {
console.error(`${colors.red('ERROR')} Unhandled promise rejection: ${error.stack}`);
});
process.on('uncaughtException', error => {
console.error(`${colors.red('ERROR')} Uncaught exception: ${error.stack}`);
});
client.login(process.env.BOT_TOKEN);