Skip to content

Commit de81bba

Browse files
authored
* feat: add since= to rest call if requested by user
* feat: add since= to rest call if requested by user * fix: a few bug fixes * fix: 401 error more explicit message * fix: changelog
1 parent be0861a commit de81bba

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
## [Unreleased]
66

7+
* Add: after-date to api call and return clearer 401 message when token needs a refresh. (@lwasser)
8+
79
## [v0.3.6] - 2024-08-15
810

911
* Add: pyos Repos that contributors contribute to (@lwasser, #197)

src/pyosmeta/github_api.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,13 @@ def return_response(self) -> list[dict[str, object]]:
176176
self.handle_rate_limit(response)
177177

178178
except requests.HTTPError as exception:
179-
raise exception
179+
if exception.response.status_code == 401:
180+
print(
181+
"Oops - your request isn't authorized. Your token may be "
182+
"expired or invalid. Please refresh your token."
183+
)
184+
else:
185+
raise exception
180186

181187
return results
182188

0 commit comments

Comments
 (0)