re-raise the original Exception instead of raising a new one

this preserves the error traceback and makes debugging easier

Change-Id: Ia513ac009b81d35e3df11939771aa29e40700c08
This commit is contained in:
Evgeni Golov 2017-11-06 13:36:17 +01:00
parent 572150f0ea
commit f2c4453df3
3 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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):

View File

@ -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)