From fa35b12622e60a745cf39d5104627ea74a56ee87 Mon Sep 17 00:00:00 2001
From: Inso <insomniak.fr@gmail.com>
Date: Mon, 9 Feb 2015 20:55:29 +0100
Subject: [PATCH] Let's try to catch all RequestException at first

---
 src/cutecoin/core/community.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/cutecoin/core/community.py b/src/cutecoin/core/community.py
index a3bc6167..e4e5b368 100644
--- a/src/cutecoin/core/community.py
+++ b/src/cutecoin/core/community.py
@@ -270,11 +270,12 @@ class Community(object):
                         continue
                     else:
                         raise
-                except Timeout:
+                except RequestException:
                     # Move the timeout peer to the end
                     self.peers.remove(peer)
                     self.peers.append(peer)
                     continue
+
         raise NoPeerAvailable(self.currency, len(self.peers))
 
     def post(self, request, req_args={}, post_args={}):
@@ -287,7 +288,7 @@ class Community(object):
                 return
             except ValueError as e:
                 raise
-            except Timeout:
+            except RequestException:
                 # Move the timeout peer to the end
                 self.peers.remove(peer)
                 self.peers.append(peer)
@@ -310,7 +311,7 @@ class Community(object):
             except ValueError as e:
                 value_error = e
                 continue
-            except Timeout:
+            except RequestException:
                 tries = tries + 1
                 # Move the timeout peer to the end
                 self.peers.remove(peer)
-- 
GitLab