This commit is contained in:
Jack Robison 2017-10-31 12:18:55 -04:00
parent f7aa478b9b
commit cfd4a94450
No known key found for this signature in database
GPG key ID: 284699E7404E3CFF

View file

@ -103,8 +103,8 @@ def check_connection(server="lbry.io", port=80, timeout=2):
log.debug('Connection successful') log.debug('Connection successful')
return True return True
except (socket.gaierror, socket.herror) as ex: except (socket.gaierror, socket.herror) as ex:
log.info("Failed to connect to %s:%s. Unable to resolve domain. Trying to bypass DNS", log.warning("Failed to connect to %s:%s. Unable to resolve domain. Trying to bypass DNS",
server, port, exc_info=True) server, port)
try: try:
server = "8.8.8.8" server = "8.8.8.8"
port = 53 port = 53
@ -112,14 +112,12 @@ def check_connection(server="lbry.io", port=80, timeout=2):
log.debug('Connection successful') log.debug('Connection successful')
return True return True
except Exception as ex: except Exception as ex:
log.info( log.error("Failed to connect to %s:%s. Maybe the internet connection is not working",
"Failed to connect to %s:%s. Maybe the internet connection is not working", server, port)
server, port, exc_info=True)
return False return False
except Exception as ex: except Exception as ex:
log.info( log.error("Failed to connect to %s:%s. Maybe the internet connection is not working",
"Failed to connect to %s:%s. Maybe the internet connection is not working", server, port)
server, port, exc_info=True)
return False return False