From ebe9df312ea73280c60fc9f2bc7caa73b919c8e0 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Sun, 23 Apr 2017 15:30:46 -0400 Subject: [PATCH] signal errors to w.when_code() waiters too This fixes the case where "wormhole send" would wait forever (upon network error) instead of terminating with a useful error message. Testing this will have to wait until we land the branch that abandons the wormhole if the first connection fails, since that's the easiest way to provoke a network error before when_code() has fired. --- src/wormhole/wormhole.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/wormhole/wormhole.py b/src/wormhole/wormhole.py index 7ab4b49..8c7150f 100644 --- a/src/wormhole/wormhole.py +++ b/src/wormhole/wormhole.py @@ -253,6 +253,8 @@ class _DeferredWormhole(object): self._observer_result = WormholeClosed(result) # but w.close() only gets error if we're unhappy self._closed_result = result + for d in self._code_observers: + d.errback(self._observer_result) for d in self._key_observers: d.errback(self._observer_result) for d in self._verifier_observers: