mirror of
https://github.com/pieartsy/PluralFlux.git
synced 2026-04-16 17:45:28 +10:00
return error when it occurs
This commit is contained in:
5
bot.js
5
bot.js
@@ -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}`);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user