Skip to content

Commit

Permalink
More detailed error message when can't find node in database tree.
Browse files Browse the repository at this point in the history
This helps you figure out what's wrong (eg. you're trying to find radical
corrections for a [C] atom).
  • Loading branch information
rwest committed Jun 11, 2011
1 parent ff22473 commit 85d36ff
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rmgpy/data/thermo.py
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,9 @@ def __getGroupThermoData(self, database, molecule, atom):
node0 = database.descendTree(molecule, atom, None)

if node0 is None:
raise KeyError('Node not found in database.')
details = ' atom={0!r}; molecule={1!r}; database="{2!s}"'.format(
atom, molecule, database.name)
raise KeyError('Node not found in database.'+details)

# It's possible (and allowed) that items in the tree may not be in the
# library, in which case we need to fall up the tree until we find an
Expand Down

0 comments on commit 85d36ff

Please sign in to comment.