Add more logging for issue #2058

This commit is contained in:
Bas Stottelaar
2014-12-31 11:44:31 +01:00
parent 91ec945a37
commit 48e2722d9e

View File

@@ -76,10 +76,15 @@ def request_response(url, method="get", auto_raise=True,
response.raise_for_status()
return response
except requests.exceptions.SSLError:
logger.error("Unable to connect to remote host because of a SSL " \
"error. It's likely the remote certificate is untrusted by your " \
"system. This check can be disabled (advanced users only).")
except requests.exceptions.SSLError as e:
if not kwargs["verify"]:
logger.error("Unable to connect to remote host because of a SSL " \
"error. It's likely the remote certificate is untrusted by " \
"your system. This check can be disabled (advanced users " \
"only).")
else:
logger.error("SSL error raised during connection, even with " \
"SSL certificate verification turned off: %s", e)
except requests.ConnectionError:
logger.error(
"Unable to connect to remote host. Check if the remote "