[ck2cti] Show line number for some parsing errors

This commit is contained in:
Ray Speth 2013-09-30 01:54:00 +00:00
parent f95bc8fb43
commit 8498123689

View file

@ -1757,11 +1757,21 @@ duplicate transport data) to be ignored.
if permissive is not None:
self.warning_as_error = not permissive
# Read input mechanism files
self.loadChemkinFile(inputFile)
try:
# Read input mechanism files
self.loadChemkinFile(inputFile)
except Exception:
print("\nERROR: Unable to parse '{0}' near line {1}:\n".format(
inputFile, self.line_number))
raise
if thermoFile:
self.loadChemkinFile(thermoFile)
try:
self.loadChemkinFile(thermoFile)
except Exception:
print("\nERROR: Unable to parse '{0}' near line {1}:\n".format(
thermoFile, self.line_number))
raise
if transportFile:
lines = open(transportFile, 'rU').readlines()