/prompt endpoint error is now in json format.
This commit is contained in:
parent
3a1f47764d
commit
e7b9d2c02c
|
@ -323,12 +323,11 @@ class PromptServer():
|
||||||
self.prompt_queue.put((number, prompt_id, prompt, extra_data, valid[2]))
|
self.prompt_queue.put((number, prompt_id, prompt, extra_data, valid[2]))
|
||||||
return web.json_response({"prompt_id": prompt_id})
|
return web.json_response({"prompt_id": prompt_id})
|
||||||
else:
|
else:
|
||||||
resp_code = 400
|
|
||||||
out_string = valid[1]
|
|
||||||
print("invalid prompt:", valid[1])
|
print("invalid prompt:", valid[1])
|
||||||
|
return web.json_response({"error": valid[1]}, status=400)
|
||||||
|
else:
|
||||||
|
return web.json_response({"error": "no prompt"}, status=400)
|
||||||
|
|
||||||
return web.Response(body=out_string, status=resp_code)
|
|
||||||
|
|
||||||
@routes.post("/queue")
|
@routes.post("/queue")
|
||||||
async def post_queue(request):
|
async def post_queue(request):
|
||||||
json_data = await request.json()
|
json_data = await request.json()
|
||||||
|
|
|
@ -163,7 +163,7 @@ class ComfyApi extends EventTarget {
|
||||||
|
|
||||||
if (res.status !== 200) {
|
if (res.status !== 200) {
|
||||||
throw {
|
throw {
|
||||||
response: await res.text(),
|
response: await res.json(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1222,7 +1222,7 @@ export class ComfyApp {
|
||||||
try {
|
try {
|
||||||
await api.queuePrompt(number, p);
|
await api.queuePrompt(number, p);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.ui.dialog.show(error.response || error.toString());
|
this.ui.dialog.show(error.response.error || error.toString());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue