Merge branch 'master' into deezer_error

This commit is contained in:
Adrian Sampson 2023-12-02 13:49:16 -05:00 committed by GitHub
commit df2d6ae753
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View file

@ -217,6 +217,9 @@ class SpotifyPlugin(MetadataSourcePlugin, BeetsPlugin):
elif e.response.status_code == 503:
self._log.error("Service Unavailable.")
raise SpotifyAPIError("Service Unavailable.")
elif e.response.status_code == 502:
self._log.error("Bad Gateway.")
raise SpotifyAPIError("Bad Gateway.")
elif e.response is not None:
raise SpotifyAPIError(
f"{self.data_source} API error:\n{e.response.text}\n"

View file

@ -150,6 +150,7 @@ Bug fixes:
* :doc:`/plugins/deezer`: Improve Deezer plugin error handling and set requests timeout to 10 seconds.
:bug:`4983`
* :doc:`/plugins/spotify`: Add bad gateway (502) error handling.
* :doc:`/plugins/spotify`: Add a limit of 3 retries, instead of retrying endlessly when the API is not available.
* Fix a crash when the Spotify API timeouts or does not return a `Retry-After` interval.
:bug:`4942`