Skip to content

Commit

Permalink
refactor: simplify error handling in incrementVote functions
Browse files Browse the repository at this point in the history
  • Loading branch information
chimpdev committed Nov 20, 2024
1 parent a8260a6 commit 8880f96
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
6 changes: 1 addition & 5 deletions server/src/utils/bots/incrementVote.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,7 @@ async function incrementVote(botId, userId, botWebhook) {
}

const response = await axios(requestConfig)
.catch(error => {
logger.error(`Error while sending webhook request for bot ${bot.id}:`, error);

return error.response;
});
.catch(error => error.response);

const data = {
url: botWebhook.url,
Expand Down
6 changes: 1 addition & 5 deletions server/src/utils/servers/incrementVote.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,7 @@ async function incrementVote(guildId, userId) {
}

const response = await axios(requestConfig)
.catch(error => {
logger.error(`Error while sending webhook request for guild ${guild.id}:`, error);

return error.response;
});
.catch(error => error.response);

const data = {
url: server.webhook.url,
Expand Down

0 comments on commit 8880f96

Please sign in to comment.