Move try catch to better handle multiple exporters

This commit is contained in:
Daniel Goldberg 2019-09-05 19:54:41 +03:00
parent 004cfa17f3
commit bf3ad35124
1 changed files with 5 additions and 5 deletions

View File

@ -27,9 +27,9 @@ class ReportExporterManager(object):
self._exporters_set.add(exporter)
def export(self, report):
try:
for exporter in self._exporters_set:
logger.debug("Trying to export using " + repr(exporter))
try:
exporter().handle_report(report)
except Exception as e:
logger.exception('Failed to export report, error: ' + e.message)