Skip to content

Commit

Permalink
Merge pull request #457 from kilicomu/bugfix/catch_missing_ro2
Browse files Browse the repository at this point in the history
Catch missing RO2 species error when prepping
  • Loading branch information
spco authored Aug 3, 2021
2 parents aeffeb2 + 283e1b6 commit dd25104
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions build/mech_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,14 @@ def convert(input_file, mech_dir, mcm_dir):
# This code only executes if the break is NOT called, i.e. if the loop runs to completion without the RO2 being
# found in the species list
else:
ro2_file.write('0 ! error RO2 not in mechanism: ' + ro2List_i + '\n')
error_message = ''.join([
' ****** ',
'Error: RO2 species "',
str(ro2List_i.strip()),
'" NOT found in the mechanism. Please check the RO2 section',
' of your mechanism file for incorrect species names!',
' ******'])
raise RuntimeError(error_message)


## ------------------------------------------------------------------ ##
Expand Down Expand Up @@ -492,4 +499,8 @@ def main():


if __name__ == '__main__':
main()
try:
main()
except RuntimeError as e:
print(str(e))
sys.exit(os.EX_DATAERR)

0 comments on commit dd25104

Please sign in to comment.