Deal with failed parameter queries properly
This commit is contained in:
parent
7ca6f6f192
commit
80916bc3fa
|
@ -10,6 +10,17 @@ async function queryParams() {
|
||||||
const json = await req.json()
|
const json = await req.json()
|
||||||
//console.log(json)
|
//console.log(json)
|
||||||
//console.log(Object.keys(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!')
|
status('parameter query successful!')
|
||||||
const paramList = document.getElementById('param-list')
|
const paramList = document.getElementById('param-list')
|
||||||
while (paramList.firstChild) {
|
while (paramList.firstChild) {
|
||||||
|
|
Loading…
Reference in New Issue