Skip to content

Commit

Permalink
fix: attempt to catch missing access on endVote
Browse files Browse the repository at this point in the history
  • Loading branch information
maybeanerd committed Apr 19, 2023
1 parent ddb8b01 commit a74ac64
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/cronjobs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,13 @@ async function endVote(vote: Vote, bot: Client) {
}
} catch (error) {
console.error(JSON.stringify(error, null, 2));

const { httpStatus } = error as any;
if (
// eslint-disable-next-line eqeqeq
(error as any).httpStatus != 404 /* 'DiscordAPIError: Unknown Message' */
httpStatus != 404 /* 'DiscordAPIError: Unknown Message' */
// eslint-disable-next-line eqeqeq
&& httpStatus != 403 /* 'DiscordAPIError: Missing Access' */
) {
throw error;
}
Expand Down

0 comments on commit a74ac64

Please sign in to comment.