From f2c4453df3b4914dabe6a9d0d65d73bd17faf4b1 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Mon, 6 Nov 2017 13:36:17 +0100 Subject: [PATCH] re-raise the original Exception instead of raising a new one this preserves the error traceback and makes debugging easier Change-Id: Ia513ac009b81d35e3df11939771aa29e40700c08 --- jenkins_jobs/builder.py | 2 +- jenkins_jobs/cache.py | 2 +- tests/cmd/subcommands/test_test.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/jenkins_jobs/builder.py b/jenkins_jobs/builder.py index 7626d461e..24ef81b13 100644 --- a/jenkins_jobs/builder.py +++ b/jenkins_jobs/builder.py @@ -146,7 +146,7 @@ class JenkinsManager(object): 'version': '', 'longName': ''}] else: - raise e + raise logger.debug("Jenkins Plugin Info {0}".format(pformat(plugins_list))) return plugins_list diff --git a/jenkins_jobs/cache.py b/jenkins_jobs/cache.py index dfcb9998b..61a79e574 100644 --- a/jenkins_jobs/cache.py +++ b/jenkins_jobs/cache.py @@ -88,7 +88,7 @@ class JobCache(object): # same time and that the other instance created the directory # after we made the check, in which case there is no error if ose.errno != errno.EEXIST: - raise ose + raise return path def set(self, job, md5): diff --git a/tests/cmd/subcommands/test_test.py b/tests/cmd/subcommands/test_test.py index 11c7679c9..a4cf0aff6 100644 --- a/tests/cmd/subcommands/test_test.py +++ b/tests/cmd/subcommands/test_test.py @@ -363,8 +363,8 @@ class TestTestsMultiPath(CmdTestsBase): def check_dirs_match(self, expected_dir): try: self.assertThat(self.output_dir, MatchesDir(expected_dir)) - except testtools.matchers.MismatchError as e: - raise e + except testtools.matchers.MismatchError: + raise else: shutil.rmtree(self.output_dir)