Open MartinDix opened 1 week ago
I think payu should raise an error instead.
Agreed. If a user doesn't want payu
to abort they should catch errors in their scripts and deal with them, and return a non-error status.
The most appropriate of the standard exceptions seems to be RuntimeError.
As far as I can tell there are no tests of running scripts in the payu tests at the moment.
Yeah RuntimeError does seem to make the most sense. I am starting on moving the logic for running user scripts out of the payu experiment class so it's easier to write some testing for it. This will also include testing for this userscript issue here: https://github.com/payu-org/payu/issues/444
At the moment errors from user scripts just result in a pretty feeble warning message
https://github.com/payu-org/payu/blob/8a4a1e2e9171f01e37bd34bfd8bb6f209f550873/payu/experiment.py#L926
which is easily missed in a log file (and doesn't even seem to appear with https://github.com/ACCESS-NRI/access-esm1.5-configs/issues/22).
I think payu should raise an error instead.