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

[or-cvs] r20025: {torflow} Better error messages on exceptions. (torflow/trunk/NetworkScanners/BwAuthority)



Author: mikeperry
Date: 2009-07-15 05:50:34 -0400 (Wed, 15 Jul 2009)
New Revision: 20025

Modified:
   torflow/trunk/NetworkScanners/BwAuthority/aggregate.py
Log:

Better error messages on exceptions.



Modified: torflow/trunk/NetworkScanners/BwAuthority/aggregate.py
===================================================================
--- torflow/trunk/NetworkScanners/BwAuthority/aggregate.py	2009-07-15 04:21:14 UTC (rev 20024)
+++ torflow/trunk/NetworkScanners/BwAuthority/aggregate.py	2009-07-15 09:50:34 UTC (rev 20025)
@@ -5,6 +5,7 @@
 import sys
 import socket
 import time
+import traceback
 
 sys.path.append("../../")
 from TorCtl.TorUtil import plog
@@ -275,5 +276,14 @@
   out.close()
  
 if __name__ == "__main__":
-  main(sys.argv)
-  sys.exit(0)
+  try:
+    main(sys.argv)
+    sys.exit(0)
+  except socket.error, e:
+    traceback.print_exc()
+    plog("NOTICE", "Socket error. Are the scanning Tors running?")
+    sys.exit(1)
+  except Exception, e:
+    plog("ERROR", "Exception during aggregate: "+str(e))
+    traceback.print_exc()
+    sys.exit(1)