From 849812368932190beaee6a6942652234538b06f4 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Mon, 30 Sep 2013 01:54:00 +0000 Subject: [PATCH] [ck2cti] Show line number for some parsing errors --- interfaces/python/ck2cti.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/interfaces/python/ck2cti.py b/interfaces/python/ck2cti.py index 29955f119..6ae0da007 100755 --- a/interfaces/python/ck2cti.py +++ b/interfaces/python/ck2cti.py @@ -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()