Added error message for generic errors
This commit is contained in:
parent
71a6795fce
commit
4fb608a955
11
main.js
11
main.js
|
@ -55,7 +55,7 @@ function createUrl() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
document.getElementById("error_dismiss").onclick = () =>{
|
document.getElementById("error_dismiss").onclick = () => {
|
||||||
document.getElementById("error_container").classList.add("hidden");
|
document.getElementById("error_container").classList.add("hidden");
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
|
@ -64,11 +64,16 @@ document.getElementById("error_dismiss").onclick = () =>{
|
||||||
*/
|
*/
|
||||||
function handleError(res) {
|
function handleError(res) {
|
||||||
if (res.status == 400) {
|
if (res.status == 400) {
|
||||||
res.text().then((body)=>{
|
res.text().then((body) => {
|
||||||
document.getElementById("error_text").innerText=body;
|
document.getElementById("error_text").innerText = body;
|
||||||
document.getElementById("error_container").classList.remove("hidden");
|
document.getElementById("error_container").classList.remove("hidden");
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
console.log(res);
|
||||||
|
document.getElementById("error_text").innerText = "An unknown error occured (see console for more details)";
|
||||||
|
document.getElementById("error_container").classList.remove("hidden");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Resets the UI
|
//Resets the UI
|
||||||
|
|
Loading…
Reference in New Issue