Unified error handling

This commit is contained in:
Skylar Grant 2023-02-19 18:59:42 -05:00
parent 4846a36e55
commit d12bb7f63a
3 changed files with 5 additions and 5 deletions

View File

@ -73,11 +73,11 @@ client.on('interactionCreate', async interaction => {
break;
case 'waterpingrole':
const waterPingStatus = await fn.buttonHandlers.waterPing(interaction);
await interaction.reply(waterPingStatus).catch(err => console.error(err));
await interaction.reply(waterPingStatus).catch(e => console.error(e));
break;
case 'fruitpingrole':
const fruitPingStatus = await fn.buttonHandlers.fruitPing(interaction);
await interaction.reply(fruitPingStatus).catch(err => console.error(err));
await interaction.reply(fruitPingStatus).catch(e => console.error(e));
break;
default:
break;

View File

@ -23,7 +23,7 @@ module.exports = {
const comparedRankings = await fn.rankings.compare(interaction, guildInfo);
const embed = fn.builders.comparisonEmbed(comparedRankings, guildInfo);
await interaction.editReply(embed).catch(err => console.error(err));
await interaction.editReply(embed).catch(e => console.error(e));
} else {
await interaction.editReply(fn.builders.errorEmbed(findMessagesResponse.status));
}
@ -40,7 +40,7 @@ module.exports = {
// Build the string that shows the comparison // TODO Move the string building section to fn.builders?
const comparedRankings = await fn.rankings.compare(interaction, guildInfo);
const embed = fn.builders.comparisonEmbed(comparedRankings, guildInfo);
await interaction.editReply(embed).catch(err => console.error(err));
await interaction.editReply(embed).catch(e => console.error(e));
} else {
await interaction.editReply(fn.builders.errorEmbed(findMessagesResponse.status));
}

View File

@ -7,7 +7,7 @@ module.exports = {
.setDescription('View information about how the bot is set up in your server')
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator),
async execute(interaction) {
await interaction.deferReply({ ephemeral: true }).catch(err => console.error(err));
await interaction.deferReply({ ephemeral: true }).catch(e => console.error(e));
try {
if (interaction.client.guildInfos.has(interaction.guildId)) {
let guildInfo = interaction.client.guildInfos.get(interaction.guildId);