Skip to content

Commit

Permalink
fix axios error
Browse files Browse the repository at this point in the history
  • Loading branch information
3vorp committed Nov 21, 2023
1 parent 78f218b commit fd1cb23
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion functions/submission/submitTexture.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,13 @@ module.exports = async function submitTexture(message) {
}

/** @type {import("@helpers/jsdoc").Texture[]} */
let results = (await axios.get(`${process.env.API_URL}textures/${search}/all`)).data;
let results = [];
try {
results = (await axios.get(`${process.env.API_URL}textures/${search}/all`)).data;
} catch {
await cancelSubmission(message, strings.submission.does_not_exist + "\n" + search);
continue;
}

// if using texture id
if (!Array.isArray(results)) results = [results];
Expand Down

0 comments on commit fd1cb23

Please sign in to comment.