Correct swift reraising of exception

When an exception was caught and rethrown, it should call 'raise'
without any arguments because it shows the place where an exception
occured initially instead of place where the exception re-raised.

Change-Id: I783a2a65f3e38a23ba49b6ae5a2f56a5fdaac2fc
This commit is contained in:
gengchc2 2016-08-26 14:08:08 +08:00
parent 01477c78c1
commit 671254224a
2 changed files with 2 additions and 4 deletions

View File

@ -386,8 +386,8 @@ class HTMLViewer(object):
else: else:
data = stats.print_stats() data = stats.print_stats()
return data, [('content-type', self.format_dict[output_format])] return data, [('content-type', self.format_dict[output_format])]
except ODFLIBNotInstalled as ex: except ODFLIBNotInstalled:
raise ex raise
except Exception as ex: except Exception as ex:
raise ProfileException(_('Data download error: %s') % ex) raise ProfileException(_('Data download error: %s') % ex)

View File

@ -429,8 +429,6 @@ class ContainerSync(Daemon):
sync_stage_time = time() sync_stage_time = time()
self.container_syncs += 1 self.container_syncs += 1
self.logger.increment('syncs') self.logger.increment('syncs')
except Exception as ex:
raise ex
finally: finally:
self.container_report(start_at, sync_stage_time, self.container_report(start_at, sync_stage_time,
sync_point1, sync_point1,