Spaces:
Paused
Paused
Update src/app/engine/render.ts
Browse files- src/app/engine/render.ts +6 -1
src/app/engine/render.ts
CHANGED
@@ -29,12 +29,14 @@ export async function newRender({
|
|
29 |
width,
|
30 |
height,
|
31 |
withCache,
|
|
|
32 |
}: {
|
33 |
prompt: string
|
34 |
// negativePrompt: string[]
|
35 |
width: number
|
36 |
height: number
|
37 |
withCache: boolean
|
|
|
38 |
}) {
|
39 |
// throw new Error("Planned maintenance")
|
40 |
|
@@ -275,8 +277,11 @@ export async function newRender({
|
|
275 |
// throw new Error('Failed to fetch data')
|
276 |
// }
|
277 |
|
278 |
-
const response = (await res.json()) as { output: string[], id: string }
|
279 |
console.log('response1: ', response)
|
|
|
|
|
|
|
280 |
// if (!response.output || !response.output[0]) {
|
281 |
// throw new Error(`Failed to fetch data`)
|
282 |
// }
|
|
|
29 |
width,
|
30 |
height,
|
31 |
withCache,
|
32 |
+
renderingEngine
|
33 |
}: {
|
34 |
prompt: string
|
35 |
// negativePrompt: string[]
|
36 |
width: number
|
37 |
height: number
|
38 |
withCache: boolean
|
39 |
+
renderingEngine: RenderingEngine
|
40 |
}) {
|
41 |
// throw new Error("Planned maintenance")
|
42 |
|
|
|
277 |
// throw new Error('Failed to fetch data')
|
278 |
// }
|
279 |
|
280 |
+
const response = (await res.json()) as { output: string[], id: string, message: string, status: string}
|
281 |
console.log('response1: ', response)
|
282 |
+
if (response.status === 'error') {
|
283 |
+
throw new Error("error")
|
284 |
+
}
|
285 |
// if (!response.output || !response.output[0]) {
|
286 |
// throw new Error(`Failed to fetch data`)
|
287 |
// }
|