[or-cvs] r18068: {torflow} Fix traceback issue for some unknown exception. (torflow/trunk/NetworkScanners)

mikeperry at seul.org mikeperry at seul.org
Sun Jan 11 01:31:39 UTC 2009


Author: mikeperry
Date: 2009-01-10 20:31:39 -0500 (Sat, 10 Jan 2009)
New Revision: 18068

Modified:
   torflow/trunk/NetworkScanners/soat.py
Log:

Fix traceback issue for some unknown exception.



Modified: torflow/trunk/NetworkScanners/soat.py
===================================================================
--- torflow/trunk/NetworkScanners/soat.py	2009-01-10 14:49:41 UTC (rev 18067)
+++ torflow/trunk/NetworkScanners/soat.py	2009-01-11 01:31:39 UTC (rev 18068)
@@ -37,6 +37,7 @@
 import time
 import urllib
 import urllib2
+import traceback
 
 import soatstats
 from soatstats import *
@@ -61,8 +62,8 @@
 #
 
 # these are used when searching for 'random' urls for testing
-wordlist_file = './wordlist.txt'; 
-allowed_filetypes = ['all','pdf'] 
+wordlist_file = './wordlist.txt';
+allowed_filetypes = ['all','pdf']
 result_per_type = 5 
 
 #
@@ -1012,6 +1013,12 @@
         except (IndexError, TypeError):
             plog('ERROR', 'An error occured while negotiating socks5 with Tor')
             return 0
+        except KeyboardInterrupt:
+            raise KeyboardInterrupt
+        except:
+            plog('ERROR', 'An unknown HTTP error occured')
+            traceback.print_exc()
+            return 0
 
         return content
 
@@ -1365,4 +1372,4 @@
         plog('INFO', "Ctrl + C was pressed. Exiting ... ")
     except Exception, e:
         plog('ERROR', "An unexpected error occured.")
-        plog('ERROR', e)
+        traceback.print_exc()



More information about the tor-commits mailing list