mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 15:44:21 +01:00
devtools: if there's a message in the API call, print and exit
If you've got bad credentials, you'll get an error message.
This commit is contained in:
@@ -66,6 +66,10 @@ def get_log_entries(commitrange):
|
|||||||
url = 'https://api.github.com/repos/{repo}/commits/{commit}/pulls'.format(repo=repo, commit=commit)
|
url = 'https://api.github.com/repos/{repo}/commits/{commit}/pulls'.format(repo=repo, commit=commit)
|
||||||
content = requests.get(url, headers=headers).json()
|
content = requests.get(url, headers=headers).json()
|
||||||
if len(content):
|
if len(content):
|
||||||
|
# Check for bad credentials
|
||||||
|
if 'message' in content:
|
||||||
|
print(content)
|
||||||
|
exit()
|
||||||
pullreq = content[0]['number']
|
pullreq = content[0]['number']
|
||||||
else:
|
else:
|
||||||
pullreq = None
|
pullreq = None
|
||||||
|
|||||||
Reference in New Issue
Block a user