Skip to content

Commit

Permalink
Provide a better error message when attempting to execute the workflo…
Browse files Browse the repository at this point in the history
…w with a missing node. (#3517)
  • Loading branch information
ltdrdata committed May 20, 2024
1 parent 09e069a commit 4bc1884
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,8 +622,17 @@ def full_type_name(klass):
def validate_prompt(prompt):
outputs = set()
for x in prompt:
if 'class_type' not in prompt[x]:
error = {
"type": "invalid_prompt",
"message": f"Cannot execute due to a missing node",
"details": f"Node ID '#{x}'",
"extra_info": {}
}
return (False, error, [], [])

class_ = nodes.NODE_CLASS_MAPPINGS[prompt[x]['class_type']]
if hasattr(class_, 'OUTPUT_NODE') and class_.OUTPUT_NODE == True:
if hasattr(class_, 'OUTPUT_NODE') and class_.OUTPUT_NODE is True:
outputs.add(x)

if len(outputs) == 0:
Expand Down

0 comments on commit 4bc1884

Please sign in to comment.