From 64d152f0e3ae788780585a9aa4b767c47d32d947 Mon Sep 17 00:00:00 2001 From: Ardis Lu Date: Thu, 8 Aug 2024 21:43:29 -0700 Subject: [PATCH] Show error message on UI to notify the user --- index.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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'); }); -- 2.47.3