From: Ardis Lu Date: Wed, 5 Oct 2022 03:38:25 +0000 (-0700) Subject: Update status on failed fetch X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=c7b86416f2e640018976a582080084bbcd605830;p=ens2hex Update status on failed fetch --- diff --git a/index.html b/index.html index c2bef53..91a6371 100644 --- a/index.html +++ b/index.html @@ -328,7 +328,12 @@ method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(batchPayload), - }).then(r => r.json()); + }) + .then(r => r.json()) + .catch(e => { + status.textContent = e; + return; + }); const table = document.querySelector('table'); table.querySelector('tbody')?.remove(); // Clear previous rows, if any