From 2e37fc72bf7578a7189bcb53ed87b85c4cb076ba Mon Sep 17 00:00:00 2001 From: jMyles Date: Tue, 6 Aug 2019 19:21:35 -0700 Subject: [PATCH] Using NodeSeemsToBeDown instead of requests-specific exception. --- nucypher/characters/lawful.py | 2 +- nucypher/network/exceptions.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/nucypher/characters/lawful.py b/nucypher/characters/lawful.py index 80897fdf8..5f7ee1601 100644 --- a/nucypher/characters/lawful.py +++ b/nucypher/characters/lawful.py @@ -715,7 +715,7 @@ class Bob(Character): for work_order in work_orders.values(): try: cfrags = self.get_reencrypted_cfrags(work_order, reuse_already_attached=cache) - except requests.exceptions.ConnectTimeout: + except NodeSeemsToBeDown: continue except NotFound: # This Ursula claims not to have a matching KFrag. Maybe this has been revoked? diff --git a/nucypher/network/exceptions.py b/nucypher/network/exceptions.py index eedc78e1b..9f0340dde 100644 --- a/nucypher/network/exceptions.py +++ b/nucypher/network/exceptions.py @@ -2,5 +2,6 @@ import requests, socket NodeSeemsToBeDown = (requests.exceptions.ConnectionError, requests.exceptions.ReadTimeout, + requests.exceptions.ConnectTimeout, socket.gaierror, ConnectionRefusedError)