better handle exceptions from listeners

This commit is contained in:
Noah Levitt 2016-03-03 18:59:13 +00:00
parent 89f965d1d3
commit 46887f7594

View File

@ -92,5 +92,9 @@ class WarcWriterThread(threading.Thread):
def _final_tasks(self, recorded_url, records):
if self.listeners:
for listener in self.listeners:
listener.notify(recorded_url, records)
try:
listener.notify(recorded_url, records)
except:
self.logger.error('%s raised exception',
listener.notify, exc_info=True)
self._log(recorded_url, records)