From 610f693a6cde47954fac4269f5647424cb5547d2 Mon Sep 17 00:00:00 2001 From: Richard West Date: Mon, 28 Jan 2019 21:25:20 -0500 Subject: [PATCH] More helpful error logging when failing to load reaction library. Might not make a difference if you could see the logging.info call two lines earlier, but when running unit tests (databaseTest) that is not necessarily the case. --- rmgpy/data/kinetics/database.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rmgpy/data/kinetics/database.py b/rmgpy/data/kinetics/database.py index 331a2dacf3b..c4cfdedab5a 100644 --- a/rmgpy/data/kinetics/database.py +++ b/rmgpy/data/kinetics/database.py @@ -248,7 +248,11 @@ def loadLibraries(self, path, libraries=None): label=os.path.dirname(library_file)[len(path)+1:] logging.info('Loading kinetics library {0} from {1}...'.format(label, library_file)) library = KineticsLibrary(label=label) - library.load(library_file, self.local_context, self.global_context) + try: + library.load(library_file, self.local_context, self.global_context) + except: + logging.error("Problem loading reaction library {0!r}".format(library_file)) + raise self.libraries[library.label] = library self.libraryOrder.append((library.label,'Reaction Library'))