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

[tor-commits] [ooni-probe/master] Add ProcessDone error string



commit 6c460223c0fe7705835ef6e46d7902d7f76ea41d
Author: Arturo Filastò <art@xxxxxxxxx>
Date:   Thu Mar 26 13:35:04 2015 +0100

    Add ProcessDone error string
    
    * Fix some bugs in geoip error handling
---
 ooni/errors.py |    6 +++++-
 ooni/geoip.py  |    4 ++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/ooni/errors.py b/ooni/errors.py
index ada7ce0..1368f45 100644
--- a/ooni/errors.py
+++ b/ooni/errors.py
@@ -6,6 +6,7 @@ from twisted.web.error import Error
 from twisted.internet.error import ConnectionRefusedError, TCPTimedOutError
 from twisted.internet.error import DNSLookupError, ConnectError, ConnectionLost
 from twisted.internet.error import TimeoutError as GenericTimeoutError
+from twisted.internet.error import ProcessDone
 
 from twisted.python import usage
 
@@ -144,6 +145,9 @@ def failureToString(failure):
         # log.err("Task timed out")
         string = 'task_timed_out'
 
+    elif isinstance(failure.value, ProcessDone):
+        string = 'process_done'
+
     else:
         # log.err("Unknown failure type: %s" % type(failure.value))
         string = 'unknown_failure %s' % str(failure.value)
@@ -346,4 +350,4 @@ class ProtocolAlreadyRegistered(Exception):
 
 
 class LibraryNotInstalledError(Exception):
-    pass
\ No newline at end of file
+    pass
diff --git a/ooni/geoip.py b/ooni/geoip.py
index 1dbc7c2..26367ff 100644
--- a/ooni/geoip.py
+++ b/ooni/geoip.py
@@ -215,9 +215,9 @@ class ProbeIP(object):
             log.msg("Found your IP via a GeoIP service: %s" % self.address)
             self.resolveGeodata()
             defer.returnValue(self.address)
-        except Exception, e:
+        except Exception:
             log.msg("Unable to lookup the probe IP via GeoIPService")
-            raise e
+            raise
 
     @defer.inlineCallbacks
     def askGeoIPService(self):



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits