From 3616f7208a45c1ba5f00c11f704eb4a081a6b22e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sven=20W=C3=A4stlund?= Date: Wed, 11 Mar 2015 16:17:10 +0100 Subject: [PATCH] socket.error is now caught in perform_request aswell. Fixes #205 --- elasticsearch/connection/thrift.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/elasticsearch/connection/thrift.py b/elasticsearch/connection/thrift.py index 442606e8..ca07d419 100644 --- a/elasticsearch/connection/thrift.py +++ b/elasticsearch/connection/thrift.py @@ -1,5 +1,6 @@ from __future__ import absolute_import from socket import timeout as SocketTimeout +from socket import error as SocketError import time import logging @@ -69,7 +70,7 @@ class ThriftConnection(PoolingConnection): except SocketTimeout as e: self.log_request_fail(method, url, body, time.time() - start, exception=e) raise ConnectionTimeout('TIMEOUT', str(e), e) - except (TException, SocketTimeout) as e: + except (TException, SocketError) as e: self.log_request_fail(method, url, body, time.time() - start, exception=e) if tclient: try: