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

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



commit 71d8151930c287c4b0e7f17940cb2954ac171f83
Author: Arturo Filastò <art@xxxxxxxxx>
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):
         """



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