mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2024-11-23 08:43:42 +01: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 jsonStr = textDecoder.decode(value)
|
||||
|
||||
let stepUpdate = undefined
|
||||
try {
|
||||
let stepUpdate = JSON.parse(jsonStr)
|
||||
|
||||
if (stepUpdate.step === undefined) {
|
||||
stepUpdate = JSON.parse(jsonStr)
|
||||
} catch (e) {
|
||||
if (e instanceof SyntaxError) {
|
||||
finalJSON += jsonStr
|
||||
} else {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
if (!stepUpdate || stepUpdate.step === undefined) {
|
||||
finalJSON += jsonStr
|
||||
} else {
|
||||
let batchSize = stepUpdate.total_steps
|
||||
@ -526,13 +532,6 @@ async function doMakeImage(task) {
|
||||
showImages(reqBody, stepUpdate, outputContainer, true)
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
if (e instanceof SyntaxError && e.message.startsWith('JSON.parse')) {
|
||||
finalJSON += jsonStr
|
||||
} else {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
prevTime = t
|
||||
} catch (e) {
|
||||
|
Loading…
Reference in New Issue
Block a user