From bc475f86c4e42baaaca40a8c966c2fe90140b1e0 Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Thu, 26 Jan 2023 23:30:29 -0500 Subject: [PATCH] Slightly better errors. --- main.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 3e25114dd..209128f15 100644 --- a/main.py +++ b/main.py @@ -220,7 +220,7 @@ def validate_inputs(prompt, item): if isinstance(type_input, list): if val not in type_input: - return (False, "Value not in list. {}, {}".format(class_type, x)) + return (False, "Value not in list. {}, {}: {} not in {}".format(class_type, x, val, type_input)) return (True, "") def validate_prompt(prompt): @@ -234,6 +234,7 @@ def validate_prompt(prompt): return (False, "Prompt has no outputs") good_outputs = set() + errors = [] for o in outputs: valid = False reason = "" @@ -250,9 +251,11 @@ def validate_prompt(prompt): else: print("Failed to validate prompt for output {} {}".format(o, reason)) print("output will be ignored") + errors += [(o, reason)] if len(good_outputs) == 0: - return (False, "Prompt has no properly connected outputs") + errors_list = "\n".join(map(lambda a: "{}".format(a[1]), errors)) + return (False, "Prompt has no properly connected outputs\n {}".format(errors_list)) return (True, "")