Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch missing RO2 species error when prepping #457

Merged
merged 2 commits into from
Aug 3, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)