def connected():
""" Check if can connect to the Amazon oAuth2
:return boolean
"""
print "Checking Internet Connection"
try:
requests.get(AlexaService.AMAZON_TOKEN_URL)
print "Connection OK"
return True
except requests.exceptions.Timeout as exception:
print "Error: Timeout / " + exception.message
except requests.exceptions.TooManyRedirects as exception:
print "Error: Invalid URL provided / " + exception.message
except requests.RequestException as exception:
print "Error: Connection Failed / " + exception.message
return False
评论列表
文章目录