[tor-commits] [ooni-probe/master] Do not swallow exception but write them to the report file

art at torproject.org art at torproject.org
Sun Dec 23 14:24:41 UTC 2012


commit 28f6bae0e354fdf44857ea84409fa7cace595526
Author: Arturo Filastò <art at fuffa.org>
Date:   Sun Dec 23 13:43:28 2012 +0100

    Do not swallow exception but write them to the report file
---
 ooni/runner.py |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/ooni/runner.py b/ooni/runner.py
index 4ebfa0b..4e0dfd6 100644
--- a/ooni/runner.py
+++ b/ooni/runner.py
@@ -185,7 +185,12 @@ def runTestCasesWithInput(test_cases, test_input, yaml_reporter,
     def test_error(failure, test_instance, test_name):
         log.err("Error in running %s" % test_name)
         log.exception(failure)
-        return
+        test_instance.report['error'] = failure
+        if not oonib_reporter:
+            return yaml_reporter.testDone(test_instance, test_name)
+        d1 = oonib_reporter.testDone(test_instance, test_name)
+        d2 = yaml_reporter.testDone(test_instance, test_name)
+        return defer.DeferredList([d1, d2])
 
     def tests_done(result, test_class):
         test_instance = test_class()





More information about the tor-commits mailing list