Fix catch socket timeout and error exceptions
This commit is contained in:
parent
63c3e1252c
commit
894086bda2
@ -39,7 +39,10 @@ class curl(object):
|
|||||||
except (httplib.HTTPException, socket.error):
|
except (httplib.HTTPException, socket.error):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
try:
|
||||||
return self.con.getresponse()
|
return self.con.getresponse()
|
||||||
|
except (socket.timeout, socket.error):
|
||||||
|
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