Improve error handling

Co-authored-by: Andreas Rammhold <andreas@rammhold.de>
This commit is contained in:
piegames 2021-03-21 18:50:06 +01:00 committed by GitHub
parent 74463a4027
commit ed6ea66495
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -198,7 +198,10 @@ def fetch_extensions() -> List[Dict[str, Any]]:
f"\tThis page only has {responseLength} entries, so it must be the last one."
)
break
except urllib.error.HTTPError:
except urllib.error.HTTPError as e:
if e.status != 404:
raise
break
# Assume this error is a 404. We hit the last page; we're done.
break