Revision b9d07587 kamaki/clients/connection/kamakicon.py
b/kamaki/clients/connection/kamakicon.py | ||
---|---|---|
35 | 35 |
#from .pool.http import get_http_connection |
36 | 36 |
from synnefo.lib.pool.http import get_http_connection |
37 | 37 |
from kamaki.clients.connection import HTTPConnection, HTTPResponse, HTTPConnectionError |
38 |
from gevent.dns import DNSError |
|
38 | 39 |
|
39 | 40 |
from json import loads |
40 | 41 |
|
... | ... | |
126 | 127 |
url=str(self.url), |
127 | 128 |
headers=http_headers, |
128 | 129 |
body=data) |
129 |
except: |
|
130 |
except Exception as err:
|
|
130 | 131 |
conn.close() |
132 |
if isinstance(err, DNSError): |
|
133 |
raise HTTPConnectionError('Cannot connect to %s'%self.url, status=701, |
|
134 |
details='%s: %s'%(type(err),unicode(err))) |
|
131 | 135 |
raise |
132 | 136 |
return KamakiHTTPResponse(conn) |
Also available in: Unified diff