mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-04-27 08:35:49 +03:00
[GH-ISSUE #259] Propagate error from couldn't refresh token #140
Labels
No labels
api-bug
bug
dependencies
documentation
duplicate
enhancement
external-ide
headless-mode
implicit-grant-flow
invalid
missing-endpoint
pr-welcome
private-api
pull-request
question
spotipy3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotipy#140
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @loisaidasam on GitHub (Feb 20, 2018).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/259
If you call
refresh_access_token(), and the response is anything other than a200, it will print the response code and failure reason tostderr, and then returnNone.Source:
github.com/plamere/spotipy@4c2c1d763a/spotipy/oauth2.py (L239-L245)This leaves the caller totally in the dark as to why the token refresh failed! What if Spotify's API had some intermittent outage? Maybe it was a bad request? Maybe something else?! How is the caller to know?
I propose either calling Requests' raise_for_status() or throwing some other sort of custom exception that passes either the entire response, or at least the error code and reason.
Thoughts?