From 33ee4455a763a20c3e520d23bbcb5e0992d2c1a7 Mon Sep 17 00:00:00 2001 From: Matchu Date: Sun, 17 Jan 2021 05:16:53 -0800 Subject: [PATCH] Gracefully handle unexpected SWF URLs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- src/server/types/AppearanceLayer.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/server/types/AppearanceLayer.js b/src/server/types/AppearanceLayer.js index f79de58..1afa7b9 100644 --- a/src/server/types/AppearanceLayer.js +++ b/src/server/types/AppearanceLayer.js @@ -203,7 +203,16 @@ const resolvers = { }; 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 // if there was no manifest, to signify that it doesn't exist, so we