[ck2cti] Improve error messages associated with missing input files
Partial cherry-pick of trunk r2856.
This commit is contained in:
parent
953fc46c27
commit
e59ca5ff6b
1 changed files with 6 additions and 0 deletions
|
|
@ -1796,6 +1796,8 @@ duplicate transport data) to be ignored.
|
|||
if permissive is not None:
|
||||
self.warning_as_error = not permissive
|
||||
|
||||
if not os.path.exists(inputFile):
|
||||
raise IOError('Missing input file: {0!r}'.format(inputFile))
|
||||
try:
|
||||
# Read input mechanism files
|
||||
self.loadChemkinFile(inputFile)
|
||||
|
|
@ -1805,6 +1807,8 @@ duplicate transport data) to be ignored.
|
|||
raise
|
||||
|
||||
if thermoFile:
|
||||
if not os.path.exists(thermoFile):
|
||||
raise IOError('Missing thermo file: {0!r}'.format(thermoFile))
|
||||
try:
|
||||
self.loadChemkinFile(thermoFile)
|
||||
except Exception:
|
||||
|
|
@ -1813,6 +1817,8 @@ duplicate transport data) to be ignored.
|
|||
raise
|
||||
|
||||
if transportFile:
|
||||
if not os.path.exists(transportFile):
|
||||
raise IOError('Missing transport file: {0!r}'.format(transportFile))
|
||||
lines = open(transportFile, 'rU').readlines()
|
||||
self.parseTransportData(lines)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue