Catch invalid JSON entries

This commit is contained in:
cmdr2 2022-09-24 13:44:10 +05:30
parent 858a1c7ae0
commit 4f58a485a6

View File

@ -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') {