From: Ardis Lu Date: Fri, 9 Aug 2024 04:43:29 +0000 (-0700) Subject: Show error message on UI to notify the user X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=64d152f0e3ae788780585a9aa4b767c47d32d947;p=block-hash-calculator Show error message on UI to notify the user --- diff --git a/index.html b/index.html index 76e5adb..080d980 100644 --- a/index.html +++ b/index.html @@ -83,8 +83,13 @@ 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'); });