Skip to content

Commit 8880f96

Browse files
committed
refactor: simplify error handling in incrementVote functions
1 parent a8260a6 commit 8880f96

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

server/src/utils/bots/incrementVote.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,7 @@ async function incrementVote(botId, userId, botWebhook) {
128128
}
129129

130130
const response = await axios(requestConfig)
131-
.catch(error => {
132-
logger.error(`Error while sending webhook request for bot ${bot.id}:`, error);
133-
134-
return error.response;
135-
});
131+
.catch(error => error.response);
136132

137133
const data = {
138134
url: botWebhook.url,

server/src/utils/servers/incrementVote.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,7 @@ async function incrementVote(guildId, userId) {
177177
}
178178

179179
const response = await axios(requestConfig)
180-
.catch(error => {
181-
logger.error(`Error while sending webhook request for guild ${guild.id}:`, error);
182-
183-
return error.response;
184-
});
180+
.catch(error => error.response);
185181

186182
const data = {
187183
url: server.webhook.url,

0 commit comments

Comments
 (0)