Frontend: Update error handling
Signed-off-by: Fred Boniface <fred@fjla.uk>
This commit is contained in:
parent
fc62114409
commit
2e3c7865e3
@ -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")
|
||||
}
|
||||
}
|
@ -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();
|
||||
|
Reference in New Issue
Block a user