diff --git a/build/mech_converter.py b/build/mech_converter.py index 4114a0e6d..0e9b12996 100644 --- a/build/mech_converter.py +++ b/build/mech_converter.py @@ -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) ## ------------------------------------------------------------------ ## @@ -492,4 +499,8 @@ def main(): if __name__ == '__main__': - main() + try: + main() + except RuntimeError as e: + print(str(e)) + sys.exit(os.EX_DATAERR)