Skip to content

Commit

Permalink
Add a test for status code from API call
Browse files Browse the repository at this point in the history
  • Loading branch information
sconklin committed Jun 9, 2023
1 parent 8dd7a16 commit 587ae71
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/get-release-downloads.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
data=res.json()
while 'next' in res.links.keys():
res=requests.get(res.links['next']['url'])
data.extend(res.json())
if res.status_code == 200:
data.extend(res.json())
else:
print(f"Error {res.status_code} getting {res.links['next']['url']}")
exit(1)

# iterate over all releases and extract the info we want
for thing in data:
Expand Down

0 comments on commit 587ae71

Please sign in to comment.