Skip to content

fix: improve error message clarity in workflow handling#3

Open
akarsh1010 wants to merge 1 commit into
MoganLab:mainfrom
akarsh1010:patch-2
Open

fix: improve error message clarity in workflow handling#3
akarsh1010 wants to merge 1 commit into
MoganLab:mainfrom
akarsh1010:patch-2

Conversation

@akarsh1010
Copy link
Copy Markdown

Fixes #2

What this PR does

Adds workflow/handler.py with descriptive error messages that replace
generic errors (e.g., "error") with context-rich messages that tell
developers exactly what failed and why.

Changes

  • Created workflow/handler.py with WorkflowError custom exception
  • load_workflow(): descriptive errors for missing path, file not found,
    permission denied, and empty file
  • validate_workflow(): descriptive errors for missing 'steps', wrong type,
    and missing 'name'/'action' fields per step
  • execute_step(): descriptive errors for non-callable actions and runtime failures
  • run_workflow(): orchestrates validation and execution with full error context

Before / After

Before After
raise Exception("error") raise WorkflowError("Workflow loading failed: 'file_path' must not be empty...")

Added workflow handling utilities including error handling and validation for workflow configurations.
@akarsh1010
Copy link
Copy Markdown
Author

Hi! I've submitted PR #3 to fix this issue. I created workflow/handler.py with descriptive error messages replacing all generic ones. Each error now tells the developer exactly what failed, why, and how to fix it. Would love your feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve error message clarity in workflow handling

1 participant