From 46887f7594234bc53cb02e0303da246e5c13937d Mon Sep 17 00:00:00 2001 From: Noah Levitt Date: Thu, 3 Mar 2016 18:59:13 +0000 Subject: [PATCH] better handle exceptions from listeners --- warcprox/writerthread.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/warcprox/writerthread.py b/warcprox/writerthread.py index 3f1642c..b3d2d9c 100644 --- a/warcprox/writerthread.py +++ b/warcprox/writerthread.py @@ -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)