Dear all,
This ticket is to request for having explicit error handling, for allowing Python interrupt gracefully with relevant exception types and error message, instead of interrupting the simulation in a hard way such as in:
E File "/stck/cassiope/git/Cassiopee/Dist/bin/ld/lib/python3.8/site-packages/FastS/PyTree.py", line 2073, in display_temporal_criteria
E import sys; sys.exit(1) # return 1 to shell
E SystemExit: 1
Where we have:
if stopAtNan:
finite = Cmpi.isFinite(t, var='centers:Density')
if not finite:
import sys; sys.exit(1) # return 1 to shell
At least I would rather prefer something like:
if stopAtNan:
finite = Cmpi.isFinite(t, var='centers:Density')
if not finite:
raise ValueError("NaN where detected at Density field")
Which explicitly tells what fails, and it is easier to handle the exception through try/except blocks, or other exception handling mechanisms.
It would be easier because we can automatically know what actually caused the solver to crash, because using try/except handling for SystemError with value 1 does not tell much of what caused the problem.
Best regards
Luis
Dear all,
This ticket is to request for having explicit error handling, for allowing Python interrupt gracefully with relevant exception types and error message, instead of interrupting the simulation in a hard way such as in:
Where we have:
At least I would rather prefer something like:
Which explicitly tells what fails, and it is easier to handle the exception through try/except blocks, or other exception handling mechanisms.
It would be easier because we can automatically know what actually caused the solver to crash, because using try/except handling for SystemError with value 1 does not tell much of what caused the problem.
Best regards
Luis