Skip to content

Commit

Permalink
Merge pull request #968 from FashionFreedom/check-api-call-status
Browse files Browse the repository at this point in the history
Add a test for status code from API call
  • Loading branch information
slspencer committed Jun 9, 2023
2 parents 8dd7a16 + 587ae71 commit 2be514e
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 2be514e

Please sign in to comment.