From 3ab4eca6d05891b3ecb9a45d19ea6b30ebeb97f8 Mon Sep 17 00:00:00 2001 From: Richard West Date: Thu, 22 Oct 2020 16:39:06 -0400 Subject: [PATCH] Report the problem species if an error occurs making a species from input file. --- rmgpy/rmg/input.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rmgpy/rmg/input.py b/rmgpy/rmg/input.py index 5d231adc5f..84662e035f 100644 --- a/rmgpy/rmg/input.py +++ b/rmgpy/rmg/input.py @@ -148,7 +148,11 @@ def species(label, structure, reactive=True): if '+' in label: raise InputError('species {0} label cannot include a + sign'.format(label)) - spec, is_new = rmg.reaction_model.make_new_species(structure, label=label, reactive=reactive) + try: + spec, is_new = rmg.reaction_model.make_new_species(structure, label=label, reactive=reactive) + except: + logging.error(f'Error when reading species "{label}" from input file.') + raise if not is_new: raise InputError("Species {0} is a duplicate of {1}. Species in input file must be unique".format(label, spec.label))