Prevent failing on api errors

This commit is contained in:
Ajay Ramachandran
2021-06-03 11:29:55 -04:00
parent 10fcc7885f
commit 1e5849f504
3 changed files with 5 additions and 7 deletions

View File

@@ -59,11 +59,8 @@ async function sendWebhooks(voteData: VoteData) {
if (config.newLeafURL !== null) {
const { err, data } = await YouTubeAPI.listVideos(submissionInfoRow.videoID);
if (err) {
Logger.error(err.toString());
return;
}
if (err) return;
const isUpvote = voteData.incrementAmount > 0;
// Send custom webhooks
dispatchEvent(isUpvote ? "vote.up" : "vote.down", {