Skip to content

Commit

Permalink
fix texture download errors for good
Browse files Browse the repository at this point in the history
  • Loading branch information
3vorp committed Aug 1, 2024
1 parent bb9a8dd commit a264662
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion functions/submission/handleResults.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const getMessages = require("@helpers/getMessages");
const getPackByChannel = require("@submission/utility/getPackByChannel");

const { mkdirSync, writeFile } = require("fs");
const handleError = require("@functions/handleError");
const axios = require("axios").default;

/**
Expand Down Expand Up @@ -44,7 +45,10 @@ async function downloadResults(client, channelResultID) {
const allContribution = [];

for (const texture of messages.map(mapMessage)) {
await downloadTexture(texture, pack, "./downloadedTextures");
// if errors aren't handled then the entire cycle gets skipped
await downloadTexture(texture, pack, "./downloadedTextures").catch((err) => {
handleError(client, err, "Texture Download Error");
});

allContribution.push(generateContributionData(texture, pack));

Expand Down

0 comments on commit a264662

Please sign in to comment.