qa/zcash/updatecheck.py: print status code and response of failed http requests.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
Daira Hopwood 2022-03-29 16:48:56 +01:00
parent 30be071d4b
commit c28b004256
1 changed files with 4 additions and 0 deletions

View File

@ -199,6 +199,8 @@ class GithubTagReleaseLister:
url = "https://api.github.com/repos/" + safe(self.org) + "/" + safe(self.repo) + "/git/refs/tags"
r = requests.get(url, auth=requests.auth.HTTPBasicAuth(self.token.user(), self.token.password()))
if r.status_code != 200:
print("API request failed (error %d)" % (r.status_code,), file=sys.stderr)
print(r.text, file=sys.stderr)
raise RuntimeError("Request to GitHub tag API failed.")
json = r.json()
return list(map(lambda t: t["ref"].split("/")[-1], json))
@ -208,6 +210,8 @@ class BerkeleyDbReleaseLister:
url = "https://www.oracle.com/database/technologies/related/berkeleydb-downloads.html"
r = requests.get(url)
if r.status_code != 200:
print("API request failed (error %d)" % (r.status_code,), file=sys.stderr)
print(r.text, file=sys.stderr)
raise RuntimeError("Request to Berkeley DB download directory failed.")
page = r.text