]> git.ardis.lu - ens2hex/commitdiff
Update status on failed fetch
authorArdis Lu <ardisglu@gmail.com>
Wed, 5 Oct 2022 03:38:25 +0000 (20:38 -0700)
committerArdis Lu <ardisglu@gmail.com>
Wed, 5 Oct 2022 03:38:25 +0000 (20:38 -0700)
index.html

index c2bef53c1b91625231d5226dad251f9fb19b56a3..91a6371f1ee82405599713dc3644542b73c33a26 100644 (file)
         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
This page took 0.041684 seconds and 4 git commands to generate.