feat (ui): netwerk map functionaliteit verder uitgebreid en polish
This commit is contained in:
@@ -165,7 +165,15 @@ async function buildImage() {
|
||||
})
|
||||
});
|
||||
|
||||
const data = await res.json();
|
||||
const ct = (res.headers.get("content-type") || "").toLowerCase();
|
||||
let data;
|
||||
|
||||
if (ct.includes("application/json")) {
|
||||
data = await res.json();
|
||||
} else {
|
||||
const text = await res.text();
|
||||
data = { ok: res.ok, status: res.status, non_json: true, body: text.slice(0, 4000) };
|
||||
}
|
||||
|
||||
if (!res.ok) {
|
||||
outputBox.value += "\nERROR:\n" + JSON.stringify(data, null, 2);
|
||||
|
||||
Reference in New Issue
Block a user