diff --git a/main.js b/main.js index c8168b4..c1481bb 100644 --- a/main.js +++ b/main.js @@ -55,18 +55,14 @@ function createUrl() { } +document.getElementById("error_dismiss").onclick = () =>{ + document.getElementById("error_container").classList.add("hidden"); +}; function handleError(res) { if (res.status == 400) { res.text().then((body)=>{ - switch (body) { - case "Shortcode already exists, please choose another code": - - break; - - default: - - break; - } + document.getElementById("error_text").innerText=body; + document.getElementById("error_container").classList.remove("hidden"); }) } }