[gnome-keysign: 1/12] wormholeoffer: prevent unhandled LonelyError



commit 6a61dc65ae5b400b8cdf94972e0b3b88f1d120eb
Author: RyuzakiKK <aasonykk gmail com>
Date:   Tue Jan 8 15:58:18 2019 +0100

    wormholeoffer: prevent unhandled LonelyError
    
    With the recent wormhole versions (probably from the 0.11.0) the close()
    behaviour slightly changed.
    In keysign output we got this message when we cancelled a pending
    sending operation:
    ```
    Unhandled error in Deferred:
    
    Traceback (most recent call last):
    Failure: wormhole.errors.LonelyError:
    ```
    To solve this I added an error callback to the close function. Because
    we still catch every possible errors in the start() function, here I
    just redirect the error output to `log.debug`.

 keysign/wormholeoffer.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/keysign/wormholeoffer.py b/keysign/wormholeoffer.py
index 8eec4b3..c9c0d8d 100644
--- a/keysign/wormholeoffer.py
+++ b/keysign/wormholeoffer.py
@@ -135,7 +135,7 @@ class WormholeOffer:
     def stop(self):
         if self.w:
             try:
-                self.w.close()
+                self.w.close().addErrback(log.debug)
             except (TransferError, ServerConnectionError, WrongPasswordError) as error:
                 # These errors should be already handled previously
                 # so here we can safely ignore them


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