Skip to content

Commit ad82f4c

Browse files
authored
Merge branch 'main' into lower-ratelimit
2 parents b90c982 + cdb6572 commit ad82f4c

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

‎github_activity/github_activity.py‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -873,8 +873,16 @@ def _get_datetime_from_git_ref(org, repo, ref, token):
873873
auth = TokenAuth(token)
874874
url = f"https://api.github.com/repos/{org}/{repo}/commits/{ref}"
875875
# prevent requests from using netrc
876-
response = requests.get(url, auth=auth)
877-
response.raise_for_status()
876+
try:
877+
response = requests.get(url, auth=auth)
878+
response.raise_for_status()
879+
except requests.exceptions.HTTPError:
880+
try:
881+
data = response.json()
882+
print(f"\n!! GitHub error: {data['message']}\n")
883+
except Exception as e:
884+
pass
885+
raise
878886
return dateutil.parser.parse(response.json()["commit"]["committer"]["date"])
879887

880888

0 commit comments

Comments
 (0)