[tor-commits] [ooni-probe/master] Clean up error messages

art at torproject.org art at torproject.org
Tue Aug 27 09:21:51 UTC 2013


commit 177e645f817890173f1e62d00da26a143564542c
Author: Arturo Filastò <art at fuffa.org>
Date:   Tue Aug 27 11:17:34 2013 +0200

    Clean up error messages
    
    * Fix bug when inputFile is not set
---
 data/nettests/blocking/http_requests.py |    1 -
 ooni/nettest.py                         |    2 ++
 ooni/templates/httpt.py                 |    8 +++++---
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/data/nettests/blocking/http_requests.py b/data/nettests/blocking/http_requests.py
index a9eb77c..8c74762 100644
--- a/data/nettests/blocking/http_requests.py
+++ b/data/nettests/blocking/http_requests.py
@@ -116,7 +116,6 @@ class HTTPRequestsTest(httpt.HTTPTest):
         experiment_request = self.doRequest(self.url, method="GET",
                 headers=headers)
 
-        log.msg("Performing GET request to %s via Tor" % self.url)
         control_request = self.doRequest(self.url, method="GET",
                 use_tor=True, headers=headers)
 
diff --git a/ooni/nettest.py b/ooni/nettest.py
index 2b170d0..f68148b 100644
--- a/ooni/nettest.py
+++ b/ooni/nettest.py
@@ -212,6 +212,8 @@ class NetTestLoader(object):
             if test_class.inputFile:
                 key = test_class.inputFile[0]
                 filename = test_class.localOptions[key]
+                if not filename:
+                    continue
                 input_file = {
                     'key': key,
                     'test_class': test_class
diff --git a/ooni/templates/httpt.py b/ooni/templates/httpt.py
index 472cc77..5542a85 100644
--- a/ooni/templates/httpt.py
+++ b/ooni/templates/httpt.py
@@ -307,7 +307,10 @@ class HTTPTest(NetTestCase):
         headers = TrueHeaders(request['headers'])
 
         def errback(failure, request):
-            log.err("Error performing %s" % request)
+            if request['tor']:
+                log.err("Error performing torified request: %s" % request['url'])
+            else:
+                log.err("Error performing request: %s" % request['url'])
             failure_string = handleAllFailures(failure)
             self.addToReport(request, failure_string=failure_string)
             return failure
@@ -315,8 +318,7 @@ class HTTPTest(NetTestCase):
         d = agent.request(request['method'], request['url'], headers,
                 body_producer)
 
+        d.addErrback(errback, request)
         d.addCallback(self._cbResponse, request, headers_processor,
                 body_processor)
-        d.addErrback(errback, request)
         return d
-





More information about the tor-commits mailing list