return error when it occurs

This commit is contained in:
Aster Fialla
2026-02-14 13:10:43 -05:00
committed by pieartsy
parent 851bae4ff8
commit 0d129f23e7
3 changed files with 6 additions and 6 deletions

5
bot.js
View File

@@ -36,9 +36,8 @@ client.on(Events.MessageCreate, async (message) => {
const command = commands.get(commandName);
if (command) {
await command.execute(message, client, args).catch(async () => {
await message.reply('An error occurred while running that command.')
throw new Error(`Error executing ${commandName}:`);
await command.execute(message, client, args).catch(async (e) => {
throw new Error(`Error executing ${commandName}: ${e.message}`);
});
}
}