catch errors in http response
This commit is contained in:
parent
8e4db5a7a2
commit
45053f9c0c
@ -39,7 +39,10 @@ class curl(object):
|
|||||||
except (httplib.HTTPException, socket.error):
|
except (httplib.HTTPException, socket.error):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
return self.con.getresponse()
|
try:
|
||||||
|
return self.con.getresponse()
|
||||||
|
except httplib.HTTPException:
|
||||||
|
return None
|
||||||
|
|
||||||
def __exit__(self, exc_type, exc_value, traceback):
|
def __exit__(self, exc_type, exc_value, traceback):
|
||||||
self.con.close()
|
self.con.close()
|
||||||
|
Loading…
Reference in New Issue
Block a user