sanitycheck: Add named exceptions

Add named exceptions instead of a generic one. Should help point to the
right issue when something goes wrong.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2020-03-24 10:34:19 -04:00
commit 923b3bf0ae

View file

@ -2665,8 +2665,12 @@ class TestSuite:
tests_to_run = len(self.instances)
logger.info("%d tests passed already, retrying %d tests" % (total_tests - tests_to_run, tests_to_run))
except Exception:
logger.error("Couldn't find input file with list of tests.")
except KeyError as e:
logger.error("Key error while parsing tests file.({})".format(str(e)))
sys.exit(2)
except FileNotFoundError as e:
logger.error("Couldn't find input file with list of tests. ({})".format(e))
sys.exit(2)
def apply_filters(self, **kwargs):