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.
Quick question: https://github.com/ansys/pyfluent/blob/1e1416aa5c9ee706159b58d152eab45a59cee44c/src/ansys/fluent/core/workflow.py#L66-L73
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.