From 80916bc3faf4149470a3a1422960701e25fde9af Mon Sep 17 00:00:00 2001 From: Kelvin Ly Date: Tue, 16 May 2023 14:49:17 -0400 Subject: [PATCH] Deal with failed parameter queries properly --- dev/admin.htm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dev/admin.htm b/dev/admin.htm index e76621b..3dc024f 100644 --- a/dev/admin.htm +++ b/dev/admin.htm @@ -10,6 +10,17 @@ async function queryParams() { const json = await req.json() //console.log(json) //console.log(Object.keys(json)) + if (!req.ok) { + var err_msg = null + if (req.body != null) { + err_msg = await req.text() + } + if (err_msg != null) { + status("query failed: " + resp.status + " " + err_msg) + } else { + status("query failed: " + resp.status) + } + } status('parameter query successful!') const paramList = document.getElementById('param-list') while (paramList.firstChild) {