[tor-commits] [ooni-probe/master] Raise NoMoreReporters exception on failure

art at torproject.org art at torproject.org
Wed Jun 19 12:32:45 UTC 2013


commit 71d8151930c287c4b0e7f17940cb2954ac171f83
Author: Arturo Filastò <art at fuffa.org>
Date:   Wed Mar 6 15:24:56 2013 +0100

    Raise NoMoreReporters exception on failure
---
 ooni/errors.py   |    4 +++-
 ooni/reporter.py |    3 +--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/ooni/errors.py b/ooni/errors.py
index 85f39ab..ca2211a 100644
--- a/ooni/errors.py
+++ b/ooni/errors.py
@@ -129,10 +129,12 @@ class AllReportersFailed(Exception):
 class GeoIPDataFilesNotFound(Exception):
     pass
 
-
 class ReportNotCreated(Exception):
     pass
 
 class ReportAlreadyClosed(Exception):
     pass
 
+class NoMoreReporters(Exception):
+    pass
+
diff --git a/ooni/reporter.py b/ooni/reporter.py
index 594c6b8..84dad2f 100644
--- a/ooni/reporter.py
+++ b/ooni/reporter.py
@@ -413,8 +413,7 @@ class Report(object):
         # Don't forward the exception unless there are no more reporters
         if len(self.reporters) == 0:
             log.err("Removed last reporter %s" % reporter)
-            failure.reporter = reporter
-            return failure
+            raise NoMoreReporters
 
     def write(self, measurement):
         """





More information about the tor-commits mailing list