Add error logs
This commit is contained in:
parent
061919cac5
commit
b725d9b662
9
index.js
9
index.js
|
@ -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);
|
Loading…
Reference in a new issue