From b725d9b6621f21f7ba12b5ea88a001b13c7b872a Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Mon, 24 Jun 2024 12:55:54 -0600 Subject: [PATCH] Add error logs --- index.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/index.js b/index.js index c996344..9f55b06 100644 --- a/index.js +++ b/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); \ No newline at end of file