From 664fa4eeb3d37f70b198904d528d6125a49e9cb1 Mon Sep 17 00:00:00 2001 From: lehmann Date: Sun, 24 Apr 2022 17:20:30 +0200 Subject: [PATCH] =?UTF-8?q?Gestion=20des=20donn=C3=A9es=20JSON=20invalides?= =?UTF-8?q?=20pour=20le=20relev=C3=A9=20BUT?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/templates/but/bulletin.html | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/templates/but/bulletin.html b/app/templates/but/bulletin.html index d394f255b5..826356ff4c 100644 --- a/app/templates/but/bulletin.html +++ b/app/templates/but/bulletin.html @@ -31,6 +31,18 @@ display: none; }`; 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";