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

art at torproject.org art at torproject.org
Tue Apr 30 13:01:44 UTC 2013


commit e389add3c449290f814f27ef578db5ee889affd5
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, 5 insertions(+), 2 deletions(-)

diff --git a/ooni/errors.py b/ooni/errors.py
index f36abb9..ac05463 100644
--- a/ooni/errors.py
+++ b/ooni/errors.py
@@ -135,6 +135,8 @@ class ReportAlreadyClosed(Exception):
 
 class TorStateNotFound(Exception):
     pass
+class ReportNotCreated(Exception):
+    pass
 
 class InsufficientPrivileges(Exception):
     pass
@@ -143,3 +145,5 @@ class ProbeIPUnknown(Exception):
     pass
 class GeoIPDataFilesNotFound(Exception):
     pass
+class NoMoreReporters(Exception):
+    pass
diff --git a/ooni/reporter.py b/ooni/reporter.py
index fc73b67..a3811b7 100644
--- a/ooni/reporter.py
+++ b/ooni/reporter.py
@@ -415,8 +415,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