Skip to content

Commit

Permalink
try catch as bandaid fix
Browse files Browse the repository at this point in the history
  • Loading branch information
3vorp committed Oct 17, 2023
1 parent 71068b0 commit cb47a4e
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/helpers/functions/missing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,13 @@ export const computeAndUpdate = async (
const results = await compute(client, pack, edition, version, callback);
if (!client) return results;

const url = `${client.tokens.apiUrl}settings/channels.pack_progress`;
console.log(url);

const packProgress = (await axios.get(url, { proxy: false })).data;

console.log(`pack progress fetched successfully: ${JSON.stringify(packProgress)}`);
let packProgress: any;
try {
/** @todo fix "Error: socket hang up" from this line of code */
packProgress = (await axios.get(`${client.tokens.apiUrl}settings/channels.pack_progress`)).data;
} catch {
return results;
}

const channel = client.channels.cache.get(packProgress[results[2].pack][results[2].edition]);
// channel doesn't exist or can't be fetched, return early
Expand Down

0 comments on commit cb47a4e

Please sign in to comment.