Skip to content

Commit

Permalink
Alert workflow parsing error (#62)
Browse files Browse the repository at this point in the history
* Alert workflow parsing error

* nit
  • Loading branch information
huchenlei authored Jun 27, 2024
1 parent 4355b43 commit 241f086
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/types/comfyWorkflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,10 @@ export async function parseComfyWorkflow(data: string): Promise<ComfyWorkflow> {
// Validate
const result = await zComfyWorkflow.safeParseAsync(JSON.parse(data));
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;
}

0 comments on commit 241f086

Please sign in to comment.