mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-04-24 19:38:23 +02:00
e.message wont start with 'JSON.parse' on mobile.
Removed message check but made the try/catch more narrow to not hide other errors.
This commit is contained in:
parent
3abd570678
commit
d1fa13d67a
@ -497,11 +497,17 @@ async function doMakeImage(task) {
|
|||||||
let timeTaken = (prevTime === -1 ? -1 : t - prevTime)
|
let timeTaken = (prevTime === -1 ? -1 : t - prevTime)
|
||||||
|
|
||||||
let jsonStr = textDecoder.decode(value)
|
let jsonStr = textDecoder.decode(value)
|
||||||
|
let stepUpdate = undefined
|
||||||
try {
|
try {
|
||||||
let stepUpdate = JSON.parse(jsonStr)
|
stepUpdate = JSON.parse(jsonStr)
|
||||||
|
} catch (e) {
|
||||||
if (stepUpdate.step === undefined) {
|
if (e instanceof SyntaxError) {
|
||||||
|
finalJSON += jsonStr
|
||||||
|
} else {
|
||||||
|
throw e
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!stepUpdate || stepUpdate.step === undefined) {
|
||||||
finalJSON += jsonStr
|
finalJSON += jsonStr
|
||||||
} else {
|
} else {
|
||||||
let batchSize = stepUpdate.total_steps
|
let batchSize = stepUpdate.total_steps
|
||||||
@ -526,13 +532,6 @@ async function doMakeImage(task) {
|
|||||||
showImages(reqBody, stepUpdate, outputContainer, true)
|
showImages(reqBody, stepUpdate, outputContainer, true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {
|
|
||||||
if (e instanceof SyntaxError && e.message.startsWith('JSON.parse')) {
|
|
||||||
finalJSON += jsonStr
|
|
||||||
} else {
|
|
||||||
throw e
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
prevTime = t
|
prevTime = t
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user