Add 502 error handling

This commit is contained in:
Alok Saboo 2023-11-28 09:58:42 -05:00
parent 4a6668a0cd
commit 753e4e9a39

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"