Skip to content

Commit

Permalink
[CTI] Improve error messages associated with problematic reactions
Browse files Browse the repository at this point in the history
  • Loading branch information
speth committed Nov 12, 2016
1 parent 44b2186 commit 828fba5
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions interfaces/cython/cantera/ctml_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1165,8 +1165,9 @@ def __init__(self,
for o in order.keys():
if (o not in self._rxnorder and
'nonreactant_orders' not in self._options):
raise CTI_Error("order specified for non-reactant: " + o +
" and no 'nonreactant_orders' option given")
raise CTI_Error("order specified for non-reactant '{}'"
" and no 'nonreactant_orders' option given"
" for reaction '{}'".format(o, self._e))
else:
self._rxnorder[o] = order[o]

Expand Down Expand Up @@ -1215,7 +1216,8 @@ def build(self, p):
mindim = ph._dim
break
if nm == -999:
raise CTI_Error("species "+s+" not found")
raise CTI_Error("species '{0}' not found while parsing "
"reaction: '{1}'.".format(s, self._e))
else:
# If no phases are defined, assume all reactants are in bulk
# phases
Expand Down Expand Up @@ -1401,7 +1403,9 @@ def clean_up_reactants_products(self):
if r[-1] == ')' and r.find('(') < 0:
species = r[:-1]
if self._eff:
raise CTI_Error('(+ '+species+') and '+self._eff+' cannot both be specified')
raise CTI_Error("In reaction '{0}', explcit third body "
"'(+ {1})' and efficiencies cannot both be "
"specified".format(self._e, species))
self._eff = species+':1.0'
self._effm = 0.0

Expand Down

0 comments on commit 828fba5

Please sign in to comment.