]> git.ardis.lu - block-hash-calculator/commitdiff
Show error message on UI to notify the user
authorArdis Lu <ardisglu@gmail.com>
Fri, 9 Aug 2024 04:43:29 +0000 (21:43 -0700)
committerArdis Lu <ardisglu@gmail.com>
Fri, 9 Aug 2024 04:43:29 +0000 (21:43 -0700)
index.html

index 76e5adbdd0b445ad2808ac7271603c316375da34..080d980378a74383f9f7055221a9225e41836205 100644 (file)
         document.querySelector('#out-header').textContent = `[\n  ${header.join(',\n  ')}\n]`;
         document.querySelector('#out-rlp').textContent = rlp;
         document.querySelector('#out-hash').textContent = hash;
-        document.querySelector('output').style.setProperty('display', 'unset');
       }
+      else {
+        document.querySelector('#out-header').textContent = `Unable to retrieve block header. Error: ${response?.message ?? 'Other'}`;
+        document.querySelector('#out-rlp').textContent = 'N/A';
+        document.querySelector('#out-hash').textContent = 'N/A';
+      }
+      document.querySelector('output').style.setProperty('display', 'unset');
 
       e.target.removeAttribute('data-loading');
     });
This page took 0.041034 seconds and 4 git commands to generate.