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

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



commit 28f6bae0e354fdf44857ea84409fa7cace595526
Author: Arturo Filastò <art@xxxxxxxxx>
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()



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