[tor-commits] [nyx/master] Better logging when tracker has an unexpected exception

atagar at torproject.org atagar at torproject.org
Mon Oct 30 17:09:05 UTC 2017


commit 494a39edce76bf3863290c20419891b7bae80409
Author: Damian Johnson <atagar at torproject.org>
Date:   Mon Oct 30 10:08:07 2017 -0700

    Better logging when tracker has an unexpected exception
    
    We shouldn't silently swallow errors. Opting for notice runlevel so they're
    visible to users by default so they can be reported.
---
 nyx/tracker.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/nyx/tracker.py b/nyx/tracker.py
index c2c4714..83159f5 100644
--- a/nyx/tracker.py
+++ b/nyx/tracker.py
@@ -396,7 +396,10 @@ class Daemon(threading.Thread):
 
       with self._process_lock:
         if self._process_pid is not None:
-          is_successful = self._task(self._process_pid, self._process_name)
+          try:
+            is_successful = self._task(self._process_pid, self._process_name)
+          except Exception as exc:
+            stem.util.log.notice('BUG: Unexpected exception from %s: %s' % (type(self).__name__, exc))
         else:
           is_successful = False
 



More information about the tor-commits mailing list