Skip to content

Commit

Permalink
fix: adding winston info wrapper for code climate errors
Browse files Browse the repository at this point in the history
  • Loading branch information
zjorge96 committed Nov 1, 2023
1 parent 076e0b3 commit 31fdb10
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions service/messageutils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const config = require("../config");
const balance = require("./balance");
const goldenRecognitionCollection = require("../database/goldenRecognitionCollection");
const { recognizeEmoji, goldenRecognizeEmoji, botName } = config;
const { SlackError, GratitudeError } = require("./errors");

async function handleSlackError(client, message, error) {
winston.error("Slack API returned an error response", {
Expand Down Expand Up @@ -57,8 +58,6 @@ function handleAllErrors(client, message, e) {
return handleSlackError(client, message, e);
} else if (e instanceof GratitudeError) {
return handleGratitudeError(client, message, e);
} else if (e instanceof GoldenGratitudeError) {
return handleGoldenGratitudeErrors(client, message, e);
} else {
return handleGenericError(client, message, e);
}
Expand Down
2 changes: 1 addition & 1 deletion service/recognition.js
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ async function respondToRecognitionReaction({ event, client }) {
sendUserNotification(client, event, gratitude),
]);
} catch (e) {
return handleError(client, event, e);
return handleAllErrors(client, event, e);
}
}

Expand Down

0 comments on commit 31fdb10

Please sign in to comment.