Catch JSON parse errors

This commit is contained in:
Joscha 2024-05-06 23:09:30 +02:00
parent dbde9288cf
commit e5ca4974d0
2 changed files with 22 additions and 8 deletions

View file

@ -24,11 +24,11 @@ function showError(msg) {
}
submit.addEventListener("click", async () => {
showStatus("Generiere...");
const data = new FormData(form);
try {
showStatus("Generiere...");
const response = await fetch(".", {
method: "post",
body: new URLSearchParams(data),