From c7b86416f2e640018976a582080084bbcd605830 Mon Sep 17 00:00:00 2001 From: Ardis Lu Date: Tue, 4 Oct 2022 20:38:25 -0700 Subject: [PATCH] Update status on failed fetch --- index.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 -- 2.47.3