Commit 5a81cdf4 authored by Lukáš Lalinský's avatar Lukáš Lalinský

Catch socket.error

parent 97269cbf
......@@ -14,6 +14,7 @@
"""Implementation of the JSON-over-HTTP RPC protocol used by Avatica."""
import socket
import httplib
import pprint
import json
......@@ -75,7 +76,7 @@ class AvaticaClient(object):
try:
self.connection = httplib.HTTPConnection(self.url.hostname, self.url.port)
self.connection.connect()
except httplib.HTTPException as e:
except (httplib.HTTPException, socket.error) as e:
raise OperationalError('Unable to connect to the specified service', e)
def close(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment