Fix glitch in test suite / improve exception handling
If applicable, fill in the issue number this pull request is fixing
Closes #1666, closes #1656
Illustration
Using the minimal example from #1656 (issue reporting unhelpful exception handling), the output is now
% python -m cantera.ck2yaml --thermo=test/data/surface2-thermo.dat --surface=test/data/surface2.inp
ERROR: Cannot specify a surface mechanism without a gas phase
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/opt/homebrew/Caskroom/miniforge/base/envs/cantera-dev/lib/python3.11/site-packages/cantera/ck2yaml.py", line 2316, in <module>
main()
File "/opt/homebrew/Caskroom/miniforge/base/envs/cantera-dev/lib/python3.11/site-packages/cantera/ck2yaml.py", line 2199, in main
parser, surfaces = Parser.convert_mech(input_file, thermo_file,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Caskroom/miniforge/base/envs/cantera-dev/lib/python3.11/site-packages/cantera/ck2yaml.py", line 2051, in convert_mech
raise InputError(msg)
InputError: Cannot specify a surface mechanism without a gas phase
Please check https://cantera.org/stable/userguide/ck2yaml-tutorial.html#debugging-common-errors-in-ck-files
for the correct Chemkin syntax.
Checklist
[x] The pull request includes a clear description of this code change
[x] Commit messages have short titles and reference relevant issues
[x] Build passes (scons build & scons test) and unit tests address code coverage
Fix glitch in test suite / improve exception handling
If applicable, fill in the issue number this pull request is fixing
Closes #1666, closes #1656
Illustration
Using the minimal example from #1656 (issue reporting unhelpful exception handling), the output is now
Checklist
scons build
&scons test
) and unit tests address code coverage