Improve user-level error messages

This commit is contained in:
Ellwood Zwovic
2017-07-27 22:33:08 -07:00
parent a2cca29383
commit 2825d0fc06

View File

@@ -236,6 +236,10 @@ class Repository:
try:
resp = requests.get(self.url, headers=req_headers, timeout=60)
except requests.exceptions.InvalidSchema as err:
raise exceptions.DownloadException("Invalid schema. Did you mean to use http://?") from err
except requests.exceptions.ConnectionError as err:
raise exceptions.DownloadException("Failed to connect. Are you sure '%s' is the correct URL?" % self.url) from err
except requests.exceptions.RequestException as err:
raise exceptions.DownloadException(err) from err