diff options
| author | user@node5.net <user@node5.net> | 2026-07-11 23:14:50 +0200 |
|---|---|---|
| committer | user@node5.net <user@node5.net> | 2026-07-11 23:14:50 +0200 |
| commit | 8b0c5b0a1c36467990481e213bc5cfa1500129d2 (patch) | |
| tree | 77c39249f82ba5b4668941685cd0748a28365b23 /src/static | |
| parent | d4968aff82ccd9c77fbdf255a73f12e974ef5a76 (diff) | |
Diffstat (limited to 'src/static')
| -rw-r--r-- | src/static/main.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/static/main.js b/src/static/main.js index 12c5e3f..02d20a2 100644 --- a/src/static/main.js +++ b/src/static/main.js @@ -4,10 +4,12 @@ async function update() { programE = document.querySelector("#program"); try { const response = await fetch("/update"); - if (response.status == 200) { + if (response.ok) { html = await response.text(); topE.innerHTML = html.split("\n").slice(0, 1)[0]; programE.outerHTML = html.split("\n").slice(1).join("\n"); + } else { + throw new Error(`Response status: ${response.status}`); } } catch (err) { // Happens when the server is closed / unreachable |
