Display the failure detail when there is one at that step.

Was checking the json object, not the server response.
This commit is contained in:
Marc-Andre Ferland
2022-10-19 05:10:37 -04:00
parent 3bdc90451a
commit 4e5ddca3bd
2 changed files with 16 additions and 6 deletions

View File

@ -509,10 +509,10 @@ async function doMakeImage(task) {
})
renderRequest = await res.json()
// status_code 503, already a task running.
} while (renderRequest.status_code === 503 && await asyncDelay(30 * 1000))
} while (res.status === 503 && await asyncDelay(30 * 1000))
if (typeof renderRequest?.stream !== 'string') {
console.log('Endpoint response: ', renderRequest)
throw new Error('Endpoint response does not contains a response stream url.')
throw new Error(renderRequest.detail || 'Endpoint response does not contains a response stream url.')
}
task['taskStatusLabel'].innerText = "Waiting"
task['taskStatusLabel'].classList.add('waitingTaskLabel')