throw an error comfyui is offline

pull/369/head
Abdullah Alfaraj 2023-11-27 03:01:57 +03:00
parent 9159ebe8f7
commit cc5a8924d1
1 changed files with 5 additions and 0 deletions

View File

@ -221,6 +221,11 @@ export async function postPromptAndGetBase64JsonResult(
}> {
try {
const res = await comfyapi.comfy_api.prompt(prompt)
if (!res) {
throw new Error(
`Unable to establish a connection to ComfyUI at the provided address: ${comfyapi.comfy_api.comfy_url}. Please ensure that ComfyUI is online and the URL is correct.`
)
}
if (res.error) {
const readable_error = comfyapi.comfy_api.getReadableError(res)
throw new Error(readable_error)