Enable us to see stack traces from with delivery threads when debuglvl > 0.
authorEric S. Raymond <esr@thyrsus.com>
Sat, 6 Oct 2012 09:05:32 +0000 (05:05 -0400)
committerEric S. Raymond <esr@thyrsus.com>
Sat, 6 Oct 2012 09:05:32 +0000 (05:05 -0400)
irkerd

diff --git a/irkerd b/irkerd
index 34fb33aae496f4402df5013c034090be7fb89c14..59efc7b6092212efece721ac91c3f3b296cfdd3b 100755 (executable)
--- a/irkerd
+++ b/irkerd
@@ -254,9 +254,13 @@ class Connection:
                     self.irker.debug(1, "XMIT_TTL bump (%s transmission) at %s" % (self.servername, time.asctime()))
                     self.queue.task_done()
         except:
-            (exc_type, _exc_value, _exc_traceback) = sys.exc_info()
+            (exc_type, _exc_value, exc_traceback) = sys.exc_info()
             self.irker.logerr("exception %s in thread for %s" % \
                               (exc_type, self.servername))
+            # This is so we can see tracebacks for errors inside the thread
+            # when we need to be able to for debugging purposes.
+            if debuglvl > 0:
+                raise exc_type, exc_value, exc_traceback
     def live(self):
         "Should this connection not be scavenged?"
         return self.status != "expired"