Skip to content

Commit

Permalink
Catch more requests errors on vercheck
Browse files Browse the repository at this point in the history
  • Loading branch information
bsquizz committed Jan 5, 2022
1 parent 0f88e80 commit bd9ad4f
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions bonfire/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,12 +488,10 @@ def check_pypi():
response = requests.get(PYPI_URL, timeout=5)
response.raise_for_status()
pkg_data = response.json()
except requests.exceptions.Timeout:
log.error("unable to reach pypi quickly, giving up.")
except requests.exceptions.HTTPError as e:
log.error("error response from pypi: ", e.errno, e.message)
except requests.exceptions.RequestException as e:
log.error("error fetching version from pypi: ", e.errno, e.message)
except ValueError:
log.error("response was not valid json, giving up.")
log.error("response was not valid json")

try:
pypi_version = pkg_data["info"]["version"]
Expand Down

0 comments on commit bd9ad4f

Please sign in to comment.