From 4f58a485a6caf00d9cac7ab588dcad7569991340 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Sat, 24 Sep 2022 13:44:10 +0530 Subject: [PATCH] Catch invalid JSON entries --- ui/index.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ui/index.html b/ui/index.html index 4d9b498c..7f38417d 100644 --- a/ui/index.html +++ b/ui/index.html @@ -952,7 +952,13 @@ async function doMakeImage(reqBody, batchCount) { res = undefined progressBar.style.display = 'none' } else { - res = JSON.parse(finalJSON) + try { + res = JSON.parse(finalJSON) + } catch (e) { + console.log('Parse error, invalid JSON', finalJSON) + throw e + } + progressBar.style.display = 'none' if (res.status !== 'succeeded') {