mirror of
https://github.com/pieartsy/PluralFlux.git
synced 2026-04-16 17:45:28 +10:00
desperately trying to make error handling work
This commit is contained in:
5
bot.js
5
bot.js
@@ -36,12 +36,11 @@ client.on(Events.MessageCreate, async (message) => {
|
||||
|
||||
const command = commands.get(commandName);
|
||||
if (command) {
|
||||
await command.execute(message, client, args).catch(async (e) => {
|
||||
throw new Error(`Error executing ${commandName}: ${e.message}`);
|
||||
});
|
||||
await command.execute(message, client, args);
|
||||
}
|
||||
}
|
||||
catch(error) {
|
||||
console.error(error);
|
||||
return await message.reply(error.message);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user