-
Notifications
You must be signed in to change notification settings - Fork 132
feat: enhance error handling from terminal output for MAPDL launch #3969
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thanks for opening a Pull Request. If you want to perform a review write a comment saying: @ansys-reviewer-bot review |
Reviewer's GuideThis PR improves the MAPDL launch workflow by capturing and persisting full terminal output (stdout and stderr), refactoring how output is collected, and providing user-friendly error handling with new exception types. Sequence Diagram: Retrieving Full Stdout/Stderr in
|
Change | Details | Files |
---|---|---|
Enhance error message composition with stderr |
|
launcher.py |
Refactor standard‐output retrieval to return aggregated text |
|
launcher.py |
Introduce QueueWithPermanentStorage to preserve all output |
|
launcher.py |
Add handle_launch_exception for custom launch errors |
|
launcher.py |
Define specialized exceptions for MPI and license issues |
|
errors.py |
Fix typo and improve server-alive check stability |
|
launcher.py |
Assessment against linked issues
Issue | Objective | Addressed | Explanation |
---|---|---|---|
#3963 | Catch and report license errors from the MAPDL process terminal when no licenses are available. | ✅ |
Tips and commands
Interacting with Sourcery
- Trigger a new review: Comment
@sourcery-ai review
on the pull request. - Continue discussions: Reply directly to Sourcery's review comments.
- Generate a GitHub issue from a review comment: Ask Sourcery to create an
issue from a review comment by replying to it. You can also reply to a
review comment with@sourcery-ai issue
to create an issue from it. - Generate a pull request title: Write
@sourcery-ai
anywhere in the pull
request title to generate a title at any time. You can also comment
@sourcery-ai title
on the pull request to (re-)generate the title at any time. - Generate a pull request summary: Write
@sourcery-ai summary
anywhere in
the pull request body to generate a PR summary at any time exactly where you
want it. You can also comment@sourcery-ai summary
on the pull request to
(re-)generate the summary at any time. - Generate reviewer's guide: Comment
@sourcery-ai guide
on the pull
request to (re-)generate the reviewer's guide at any time. - Resolve all Sourcery comments: Comment
@sourcery-ai resolve
on the
pull request to resolve all Sourcery comments. Useful if you've already
addressed all the comments and don't want to see them anymore. - Dismiss all Sourcery reviews: Comment
@sourcery-ai dismiss
on the pull
request to dismiss all existing Sourcery reviews. Especially useful if you
want to start fresh with a new review - don't forget to comment
@sourcery-ai review
to trigger a new review!
Customizing Your Experience
Access your dashboard to:
- Enable or disable review features such as the Sourcery-generated pull request
summary, the reviewer's guide, and others. - Change the review language.
- Add, remove or edit custom review instructions.
- Adjust other review settings.
Getting Help
- Contact our support team for questions or feedback.
- Visit our documentation for detailed guides and information.
- Keep in touch with the Sourcery team by following us on X/Twitter, LinkedIn or GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @germa89 - I've reviewed your changes - here's some feedback:
- QueueWithPermanentStorage only overrides get(), but _get_std_output uses get_nowait(), so storage_text will always be empty—either override get_nowait or record items on put to ensure you capture everything.
- The helper _get_std_output now returns a single string instead of a List[str] yet its name, signature, and docstring weren’t updated—please revise those or rename the function for clarity.
- There’s duplicated logic building the stderr/stdout error message in check_mapdl_launch—consider extracting that into a shared helper to ensure consistent formatting.
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
… instance management
…ge formatting for MAPDL launch
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
…prove error handling
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3969 +/- ##
==========================================
+ Coverage 88.25% 89.11% +0.85%
==========================================
Files 187 187
Lines 14935 14968 +33
==========================================
+ Hits 13181 13338 +157
+ Misses 1754 1630 -124 🚀 New features to boost your workflow:
|
@pyansys-ci-bot LGTM. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description
As the title. Now we also consider the stderr output before raising an error.
Implemented class
QueueWithPermanentStorage
which allows for checking the full output for both stdout and stderr.Issue linked
Close #3963
Checklist
draft
if it is not ready to be reviewed yet.feat: adding new MAPDL command
)Summary by Sourcery
Enhance MAPDL launch error handling by capturing and persisting both stdout and stderr outputs and mapping common launch failures to user-friendly exceptions.
New Features:
Bug Fixes:
Enhancements:
Documentation: