propagate exception correctly to outer scope

This commit is contained in:
Tomas Kopecek 2017-05-03 14:22:38 +02:00
parent 6d5dc301d3
commit 119ecf2122

View file

@ -234,13 +234,15 @@ class BaseTaskHandler(object):
if all:
if failany:
failed = False
task_error = None
for task in finished:
if task in canfail:
# no point in checking
continue
try:
self.session.getTaskResult(task)
except (koji.GenericError, six.moves.xmlrpc_client.Fault) as task_error:
except (koji.GenericError, six.moves.xmlrpc_client.Fault) as te:
task_error = te
self.logger.info("task %s failed or was canceled" % task)
failed = True
break