Skip to content

Commit

Permalink
whoops
Browse files Browse the repository at this point in the history
  • Loading branch information
3vorp committed Dec 10, 2023
1 parent 84475b9 commit 57a8a7d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/helpers/functions/getTexture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,13 @@ export async function getTexture(interaction: Interaction, texture: Texture, pac
iconURL,
});

const { data: textureURL } = await axios
.get(`${apiUrl}textures/${texture.id}/url/${pack}/latest`)
.catch(() => ({ data: "" }));
let textureURL: string;
try {
textureURL = (await axios.get(`${apiUrl}textures/${texture.id}/url/${pack}/latest`)).request.res
.responseUrl;
} catch {
textureURL = "";
}

// test if url isn't a 404
let image: Image;
Expand Down

0 comments on commit 57a8a7d

Please sign in to comment.