forked from ScoDoc/ScoDoc
Gestion des données JSON invalides pour le relevé BUT
This commit is contained in:
parent
bae33cf86b
commit
664fa4eeb3
@ -31,6 +31,18 @@
|
|||||||
display: none;
|
display: none;
|
||||||
}`;
|
}`;
|
||||||
releve.shadowRoot.appendChild(style);
|
releve.shadowRoot.appendChild(style);
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
let div = document.createElement("div");
|
||||||
|
div.innerText = "Une erreur s'est produite lors du transfère des données.";
|
||||||
|
div.style.fontSize = "24px";
|
||||||
|
div.style.color = "#d93030";
|
||||||
|
|
||||||
|
let releve = document.querySelector("releve-but");
|
||||||
|
releve.after(div);
|
||||||
|
releve.remove();
|
||||||
|
|
||||||
|
throw 'Fin du script - données invalides';
|
||||||
});
|
});
|
||||||
document.querySelector("html").style.scrollBehavior = "smooth";
|
document.querySelector("html").style.scrollBehavior = "smooth";
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user