Frontend: Update error handling

Signed-off-by: Fred Boniface <fred@fjla.uk>
This commit is contained in:
Fred Boniface 2023-01-27 13:41:33 +00:00
parent fc62114409
commit 2e3c7865e3
2 changed files with 4 additions and 2 deletions

View File

@ -236,9 +236,10 @@ async function errorHandler() {
errCount += 1;
sessionStorage.setItem("failcount", errCount.toString())
if (errCount < 10){
await delay(2000);
await delay(3000);
location.reload()
} else {
sessionStorage.removeItem("failcount");
window.location.assign("conn-err.html")
}
}

View File

@ -20,7 +20,7 @@ async function init() {
log("simple-board.init: Fetched LDB Data", "INFO")
} catch (err) {
var data = "err"
setLoadingDesc(`Handling\nError`)
setLoadingDesc(`Waiting\nConnection`)
log(`simple-board.init: Error fetching data: ${err}`, "ERR")
}
parseLdb(data)
@ -46,6 +46,7 @@ async function parseLdb(data) {
document.getElementById("error_notice").style = "display: block;";
document.getElementById("err_conn").style = "display: block;";
setHeaders("Connection Error",new Date())
showLoading();
await delay(5000);
log(`parseLdb: Passing to error handler`, "ERR")
errorHandler();