fix: enhance error handling in run command by restoring original stdout/stderr before outputting error messages#10186
Conversation
…tderr before outputting error messages
- Bump revision to 3 - Update dependency markers for several packages to improve compatibility with Python 3.12 and specific platforms - Increment version numbers for langflow (1.6.4) and langflow-base (0.6.4) - Adjust dependency markers for packages related to darwin platform
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughException handling in the CLI graph execution path now restores stdout and stderr before calling output_error and re-raising. Restoration occurs inside the except block; the finally block is unchanged. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant User
participant CLI as CLI run.py
participant Exec as Graph Executor
participant Log as output_error
User->>CLI: invoke run
CLI->>Exec: execute_graph()
alt success
Exec-->>CLI: result
CLI-->>User: normal completion
else error
Exec--x CLI: raise Exception
rect rgba(255,235,205,0.5)
note right of CLI: New behavior in error path
CLI->>CLI: restore stdout/stderr
CLI->>Log: output_error(err)
CLI--x User: propagate exception
end
end
opt finally
note over CLI: finalize/cleanup (unchanged)
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks and finishing touches❌ Failed checks (1 error, 2 warnings)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ Your project status has failed because the head coverage (47.06%) is below the target coverage (55.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #10186 +/- ##
==========================================
+ Coverage 24.12% 24.14% +0.02%
==========================================
Files 1088 1088
Lines 40132 40093 -39
Branches 5561 5548 -13
==========================================
Hits 9680 9680
+ Misses 30281 30242 -39
Partials 171 171
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|



This was causing tests to fail because they just check that something outputs to stdout.
E.g:
Summary by CodeRabbit