You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"""Raised on an attempt to create command for a given task."""
def__init__(self, task_name):
super().__init__(f"Could not create command for task {task_name}")
task_cmd_name=task.CommandName()
Isn't this definition for a custom Exception nested inside a non-public method kind of useless, in the sense that users won't easily be able to import and catch this NewCommandError? In which case this 5 lines definition could be replaced with just Exception(f"Could not create command for task {task_name}") as it would be caught using except Exception: regardless?
Otherwise I think this custom exception definition should be moved outside of the non-public method, so that it can more easily be imported if an user wants to catch it.
The text was updated successfully, but these errors were encountered:
Quick question:
pyfluent/src/ansys/fluent/core/workflow.py
Lines 66 to 73 in 1e1416a
Isn't this definition for a custom
Exception
nested inside a non-public method kind of useless, in the sense that users won't easily be able to import and catch thisNewCommandError
? In which case this 5 lines definition could be replaced with justException(f"Could not create command for task {task_name}")
as it would be caught usingexcept Exception:
regardless?Otherwise I think this custom exception definition should be moved outside of the non-public method, so that it can more easily be imported if an user wants to catch it.
The text was updated successfully, but these errors were encountered: