[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r18181: {weather} Catch the right Exception, lets log both types of exceptions (weather/trunk)



Author: ioerror
Date: 2009-01-19 16:22:22 -0500 (Mon, 19 Jan 2009)
New Revision: 18181

Modified:
   weather/trunk/poll.py
Log:
Catch the right Exception, lets log both types of exceptions.


Modified: weather/trunk/poll.py
===================================================================
--- weather/trunk/poll.py	2009-01-19 20:54:53 UTC (rev 18180)
+++ weather/trunk/poll.py	2009-01-19 21:22:22 UTC (rev 18181)
@@ -53,16 +53,21 @@
     string = "ns/id/" + node_id
     try:
        info = self.control.get_info(string)
-    except ErrorReply:
+    except TorCtl.ErrorReply:
         # If we're getting here, we're likely seeing:
         # ErrorReply: 552 Unrecognized key "ns/id/46D9..."
         # This means that the node isn't recognized by 
+       x = traceback.format_exc()
+       fh = file("/tmp/tor-ctl-failed-ping-log", "a")
+       fh.write(x)
+       fh.close()
+       info = None
        return False
 
     except:
         # Remove this, it's a hack to debug this specific bug
         x = traceback.format_exc()
-        fh = file("/tmp/failed-ping-log", "a")
+        fh = file("/tmp/misc-failed-ping-log", "a")
         fh.write(x)
         fh.close()
         info = None