From d12bb7f63a74ef234ab34a9ed0e0dde60b3bb5ef Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Sun, 19 Feb 2023 18:59:42 -0500 Subject: [PATCH] Unified error handling --- main.js | 4 ++-- slash-commands/compare.js | 4 ++-- slash-commands/setupinfo.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/main.js b/main.js index c735994..2753916 100755 --- a/main.js +++ b/main.js @@ -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; diff --git a/slash-commands/compare.js b/slash-commands/compare.js index c94d48f..4a34ca2 100755 --- a/slash-commands/compare.js +++ b/slash-commands/compare.js @@ -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)); } diff --git a/slash-commands/setupinfo.js b/slash-commands/setupinfo.js index 3f77d97..be409c6 100755 --- a/slash-commands/setupinfo.js +++ b/slash-commands/setupinfo.js @@ -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);