Skip to content

python can now know when a command fails: execute(cmd, check=True) - #302

Open
antonio-leblanc wants to merge 5 commits into
devfrom
execute-status
Open

antonio-leblanc wants to merge 5 commits into
devfrom
execute-status

Conversation

@antonio-leblanc

@antonio-leblanc antonio-leblanc commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

most commands already return an error, but ExecuteCommand did not, so python had no way to know a command failed

  • now ExecuteCommand returns the error too (nobody uses it today so nothing changes)
  • in python: ff.execute(cmd, check=True) gives an error when the command fails. default is still False
  • step, include, setParameters and loadData also return the error of the commands inside them
  • simulation is the same, tests ok (ctest, runff, runANN)
  • small changes: system[...] with exit != 0 is now an error, and a line with only spaces does not crash anymore
  • step, print, plot and addLayer without a domain, and include of a file that does not exist, now return error too (you only see it with check=True)

the error message still goes to cout, so python only says "command failed"... #165 (logging levels) can fix this later

Unknown command, bad @ operator and the BadOption/MissingOption/MissingTime catches return error. Callers that ignore the return are unchanged. No change to what is printed.
… fails

ForeFireRunner forwards keyword arguments to the worker, so check=True works there too.
step returns what goTo returns, and error without a domain, like goTo. print, plot and addLayer without a domain return error. include returns error for a missing file or a failed line, loadData when the domain it builds fails. A line starting with [ no longer throws out_of_range. Nothing printed changes.
… line is a no-op

A line of only tabs or four spaces used to throw out_of_range; it is now skipped like a comment.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant