Report Error on status page if content page returns error
This commit is contained in:
parent
51aa0c805e
commit
7c907fe0ce
@ -164,9 +164,13 @@
|
|||||||
fetch("?content", { credentials: "same-origin" })
|
fetch("?content", { credentials: "same-origin" })
|
||||||
.then(function(response) {
|
.then(function(response) {
|
||||||
if (response.ok) return response.text();
|
if (response.ok) return response.text();
|
||||||
|
throw new Error();
|
||||||
})
|
})
|
||||||
.then(function(html) {
|
.then(function(html) {
|
||||||
if (html) document.getElementById("content").innerHTML = html;
|
document.getElementById("content").innerHTML = html;
|
||||||
|
})
|
||||||
|
.catch(function() {
|
||||||
|
document.getElementById("content").innerHTML = "Error";
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user