From c072ec46f6ae9b77b0a279b292b5be0130f66901 Mon Sep 17 00:00:00 2001 From: Helio Machado <0x2b3bfa0+git@googlemail.com> Date: Wed, 17 Mar 2021 14:32:43 +0100 Subject: [PATCH] Add debugging message for #443 This commit doesn't fix #443, but closes it until we can reproduce again the error. --- src/utils.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/utils.js b/src/utils.js index 12e07031f..c3781018b 100644 --- a/src/utils.js +++ b/src/utils.js @@ -78,6 +78,11 @@ const upload = async (opts) => { const response = await fetch(endpoint, { method: 'POST', headers, body }); const uri = await response.text(); + if (!uri) + throw new Error( + `Empty response from asset backend with status code ${response.status}` + ); + return { uri, mime, size }; };