Fixed UnboundLocalError #571 (#580)

This commit is contained in:
Nicklas Tegner authored and GitHub committed 2020-10-02 22:26:47 +01:00
1 parent 406f7deeda
commit 18e82b6625
2 files changed
+8 -3

No files matched your search

+4 -2
View File
@@ -243,7 +243,8 @@ class Spotify(object):
response.raise_for_status()
results = response.json()
except requests.exceptions.HTTPError:
except requests.exceptions.HTTPError as http_error:
response = http_error.response
try:
msg = response.json()["error"]["message"]
except (ValueError, KeyError):
@@ -263,7 +264,8 @@ class Spotify(object):
reason=reason,
headers=response.headers,
)
except requests.exceptions.RetryError:
except requests.exceptions.RetryError as retry_error:
response = retry_error.response
logger.error('Max Retries reached')
raise SpotifyException(
599,