Skip to content

Comments

Add enhanced error messages with execution context This commit implements comprehensive error reporting for DAG execution failures: Features: - New NodeExecutionError exception that wraps all execution failures - Captures the complete execution path showing which nodes were executed - Records all inputs passed to the failed node - Preserves the original exception for detailed debugging - Properly formatted error messages with visual separators - Full support for both sync and async execution - Picklable for multiprocessing support Changes: - Added NodeExecutionError class with rich context information - Updated ExecutionContext to track execution path - Modified run_sync and run_async to wrap exceptions with context - Updated all tests to work with new exception wrapping - Added comprehensive test suite for error messages - Created error_handling_example.py to demonstrate the feature All 82 tests pass, including 8 new tests for enhanced error messages.#6

Merged
JBloss1517 merged 6 commits intomainfrom
claude/improve-error-messages-011CV1HDGFQDBjCN6qg2qB8y
Nov 11, 2025

Conversation

@JBloss1517
Copy link
Contributor

No description provided.

This commit implements comprehensive error reporting for DAG execution failures:

Features:
- New NodeExecutionError exception that wraps all execution failures
- Captures the complete execution path showing which nodes were executed
- Records all inputs passed to the failed node
- Preserves the original exception for detailed debugging
- Properly formatted error messages with visual separators
- Full support for both sync and async execution
- Picklable for multiprocessing support

Changes:
- Added NodeExecutionError class with rich context information
- Updated ExecutionContext to track execution path
- Modified run_sync and run_async to wrap exceptions with context
- Updated all tests to work with new exception wrapping
- Added comprehensive test suite for error messages
- Created error_handling_example.py to demonstrate the feature

All 82 tests pass, including 8 new tests for enhanced error messages.
- Use shutil.get_terminal_size() to get current terminal width
- Dynamically adjust separator bars to match terminal width
- Fallback to 80 columns if terminal size unavailable
- Prevents ugly wrapping of error message separators
- Add proper type annotations for default_factory functions in ExecutionContext
- Add type narrowing assertions in tests for NodeExecutionError
- Add explicit type annotation for lines list in _format_inputs
- Format code with ruff

All 82 tests pass, pyright shows 0 errors, linting passes.
The type validation example now correctly expects NodeExecutionError
instead of ValidationError, since all execution errors are now wrapped
with execution context.
Added tests to cover:
- Terminal width fallback when get_terminal_size fails
- Error formatting with no inputs
- Async input validation errors
- Async output validation errors
- Exception pickling/unpickling

All 87 tests pass with 100% code coverage.
@JBloss1517 JBloss1517 merged commit eef10ee into main Nov 11, 2025
6 checks passed
@JBloss1517 JBloss1517 deleted the claude/improve-error-messages-011CV1HDGFQDBjCN6qg2qB8y branch November 11, 2025 14:03
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.

2 participants