Gracefully handle unexpected SWF URLs

Fixing our support for our "Totally Legit DTI Graffiti" item 😅

In addition to this change, I also uploaded the images to the correct URLs: the old site was doing the folder algorithm in a surprising way, yielding https://impress-asset-images.s3.amazonaws.com/object/000/000/0-1/-1/600x600.png, whereas the new site was doing the (imo clearer) https://impress-asset-images.s3.amazonaws.com/object/000/000/000/-1/600x600.png. I copied the files to the new location.

I also noticed that the thumbnail URL for that item has been broken for a while, so I created a new copy at https://impress-asset-images.s3.amazonaws.com/object/000/000/000/-1/80x80.png, and updated the database record to point to it.

This should resolve Sentry error IMPRESS-2020-6.
This commit is contained in:
Emi Matchu 2021-01-17 05:16:53 -08:00
parent 7393991046
commit 33ee4455a7

View file

@ -203,7 +203,16 @@ const resolvers = {
}; };
async function loadAndCacheAssetManifest(db, layer) { async function loadAndCacheAssetManifest(db, layer) {
let manifest = await loadAssetManifest(layer.url); let manifest;
try {
manifest = await loadAssetManifest(layer.url);
} catch (e) {
console.error(
new Error("Error loading asset manifest, caused by the error below")
);
console.error(e);
return null;
}
// Then, write the new manifest. We make sure to write an empty string // Then, write the new manifest. We make sure to write an empty string
// if there was no manifest, to signify that it doesn't exist, so we // if there was no manifest, to signify that it doesn't exist, so we