Deal with failed parameter queries properly

This commit is contained in:
Kelvin Ly 2023-05-16 14:49:17 -04:00
parent 7ca6f6f192
commit 80916bc3fa
1 changed files with 11 additions and 0 deletions

View File

@ -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) {