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: