Example #1
0
 def result(self):
     """Retrieve final result of connection-observer"""
     if self.cancelled():
         raise NoResultSinceCancelCalled(self)
     if self._exception:
         raise self._exception
     if not self.done():
         raise ResultNotAvailableYet(self)
     return self._result
Example #2
0
 def result(self):
     """Retrieve final result of connection-observer"""
     with ConnectionObserver._exceptions_lock:
         ConnectionObserver._log_unraised_exceptions(self)
         if self._exception:
             exception = self._exception
             if exception in ConnectionObserver._not_raised_exceptions:
                 ConnectionObserver._not_raised_exceptions.remove(exception)
             raise exception
     if self.cancelled():
         raise NoResultSinceCancelCalled(self)
     if not self.done():
         raise ResultNotAvailableYet(self)
     return self._result
Example #3
0
 def result(self):
     """Retrieve final result of connection-observer"""
     with ConnectionObserver._exceptions_lock:
         ConnectionObserver._log_unraised_exceptions(self)
         if self._exception:
             exception = self._exception
             if exception in ConnectionObserver._not_raised_exceptions:
                 ConnectionObserver._not_raised_exceptions.remove(exception)
             self._log(
                 logging.INFO, "Stack stored with the exception: {}".format(
                     self._exception_stack_msg))
             raise exception
     if self.cancelled():
         raise NoResultSinceCancelCalled(self)
     if not self.done():
         raise ResultNotAvailableYet(self)
     return self._result