-
Notifications
You must be signed in to change notification settings - Fork 142
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
Refactor function handler #4463
Conversation
- Failed method raise exception - Failed method release the desktop
- Failed method raise exception - Failed method release the desktop
# Conflicts: # pyaedt/generic/general_methods.py
Thanks for opening a Pull Request. If you want to perform a review write a comment saying: @ansys-reviewer-bot review |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4463 +/- ##
==========================================
- Coverage 81.45% 76.39% -5.06%
==========================================
Files 109 109
Lines 53538 53553 +15
==========================================
- Hits 43607 40910 -2697
- Misses 9931 12643 +2712 |
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.
Since the line of codes
if not settings.enable_error_handler:
if settings.release_on_exception:
from pyaedt.generic.desktop_sessions import _desktop_sessions
for v in list(_desktop_sessions.values())[:]:
v.release_desktop(v.launched_by_pyaedt, v.launched_by_pyaedt)
raise e
else:
return False
are used in every exception handling, could we have an inner function in wrapper
to refactor that and call it every time it is needed ?
Implemented |
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.
LGTM
# Conflicts: # pyaedt/desktop.py
Following my request changes in #4463, it seems that the pyaedt_function_handler function was not working correctly. Indeed, if an exception was raised and the settings were such that one would want the function handler to return False, no value was returned by the function (leading to a None return).
No description provided.