mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-06-19 09:13:53 +00:00
parent
406f7deeda
commit
18e82b6625
@ -7,7 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
// Add your changes here and then delete this line
|
### Fixed
|
||||||
|
|
||||||
|
- UnboundLocalError when a request fails ( #571 )
|
||||||
|
|
||||||
|
|
||||||
## [2.16.0] - 2020-09-16
|
## [2.16.0] - 2020-09-16
|
||||||
|
|
||||||
|
|||||||
@ -243,7 +243,8 @@ class Spotify(object):
|
|||||||
|
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
results = response.json()
|
results = response.json()
|
||||||
except requests.exceptions.HTTPError:
|
except requests.exceptions.HTTPError as http_error:
|
||||||
|
response = http_error.response
|
||||||
try:
|
try:
|
||||||
msg = response.json()["error"]["message"]
|
msg = response.json()["error"]["message"]
|
||||||
except (ValueError, KeyError):
|
except (ValueError, KeyError):
|
||||||
@ -263,7 +264,8 @@ class Spotify(object):
|
|||||||
reason=reason,
|
reason=reason,
|
||||||
headers=response.headers,
|
headers=response.headers,
|
||||||
)
|
)
|
||||||
except requests.exceptions.RetryError:
|
except requests.exceptions.RetryError as retry_error:
|
||||||
|
response = retry_error.response
|
||||||
logger.error('Max Retries reached')
|
logger.error('Max Retries reached')
|
||||||
raise SpotifyException(
|
raise SpotifyException(
|
||||||
599,
|
599,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user