mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 11:11:53 +00:00
Alert workflow parsing error (#62)
* Alert workflow parsing error * nit
This commit is contained in:
@@ -112,7 +112,10 @@ export async function parseComfyWorkflow(data: string): Promise<ComfyWorkflow> {
|
|||||||
// Validate
|
// Validate
|
||||||
const result = await zComfyWorkflow.safeParseAsync(JSON.parse(data));
|
const result = await zComfyWorkflow.safeParseAsync(JSON.parse(data));
|
||||||
if (!result.success) {
|
if (!result.success) {
|
||||||
throw fromZodError(result.error);
|
// TODO: Pretty print the error on UI modal.
|
||||||
|
const error = fromZodError(result.error);
|
||||||
|
alert(`Invalid workflow against zod schema:\n${error}`);
|
||||||
|
throw error;
|
||||||
}
|
}
|
||||||
return result.data;
|
return result.data;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user