catch exception raised if url is not reachable
This commit is contained in:
parent
558ba16bc2
commit
f14f22636f
|
@ -28,8 +28,11 @@ class Exchanger(threading.Thread):
|
||||||
self.discovery()
|
self.discovery()
|
||||||
|
|
||||||
def discovery(self):
|
def discovery(self):
|
||||||
connection = httplib.HTTPSConnection('blockchain.info')
|
try:
|
||||||
connection.request("GET", "/ticker")
|
connection = httplib.HTTPSConnection('blockchain.info')
|
||||||
|
connection.request("GET", "/ticker")
|
||||||
|
except:
|
||||||
|
return
|
||||||
response = connection.getresponse()
|
response = connection.getresponse()
|
||||||
if response.reason == httplib.responses[httplib.NOT_FOUND]:
|
if response.reason == httplib.responses[httplib.NOT_FOUND]:
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue