-
Notifications
You must be signed in to change notification settings - Fork 954
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UnboundLocalError: local variable 'response' referenced before assignment #571
Labels
Comments
stephanebruckert
pushed a commit
that referenced
this issue
Oct 2, 2020
Should be fixed by #580 |
stephanebruckert
added a commit
that referenced
this issue
Oct 6, 2020
stephanebruckert
added a commit
that referenced
this issue
Oct 6, 2020
Quizz1Cal
added a commit
to Quizz1Cal/spotipy
that referenced
this issue
Oct 6, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
If something goes wrong in
self._session.request()
the variableresponse
will never be set. Leading to aUnboundLocalError: local variable 'response' referenced before assignment
Your code
Sorry.
Error from my Rollbar:
Expected behavior
Requests fail and that's fine. Judging from skimming the code, it's trying to package a message to go with raising a
SpotifyException
but it's failing to do so.Output
Paste and format errors (with complete stacktrace) or logs. Make sure to remove sensitive information.
Environment:
spotipy==2.13.0
Additional context
Relying on
UnboundLocalError
from a caller isn't nice. If it wasSpotifyException
I could do something like this:The text was updated successfully, but these errors were encountered: