idaholab / moose

Multiphysics Object Oriented Simulation Environment
https://www.mooseframework.org
GNU Lesser General Public License v2.1
1.6k stars 1k forks source link

Catch more exceptions in premake #27495

Open loganharbour opened 3 weeks ago

loganharbour commented 3 weeks ago

Motivation

Exceptions aren't caught early on in premake, so you could end up with the following:

Traceback (most recent call last):
  File "/home/schwd/Programs/moose-GPU-build//framework/../scripts/premake.py", line 183, in <module>
    PreMake().check()
    ^^^^^^^^^
  File "/home/schwd/Programs/moose-GPU-build//framework/../scripts/premake.py", line 18, in __init__
    self.versioner_meta = Versioner().version_meta()
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/schwd/Programs/moose-GPU-build/scripts/versioner.py", line 277, in version_meta
    packages = self.get_yamlcontents(commit)['packages']
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/schwd/Programs/moose-GPU-build/scripts/versioner.py", line 103, in get_yamlcontents
    yaml_contents = yaml.safe_load(self.git_file(yaml_file, commit))
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/schwd/Programs/moose-GPU-build/scripts/versioner.py", line 196, in git_file
    raise Exception(f'Failed to load {file} in {repo_dir} at {commit}')

Design

Catch more exceptions so that we can provide more context

Impact

Better user environment support