mirror of
https://github.com/beetbox/beets.git
synced 2025-12-07 17:16:07 +01:00
Add 502 error handling
This commit is contained in:
parent
4a6668a0cd
commit
753e4e9a39
1 changed files with 3 additions and 0 deletions
|
|
@ -217,6 +217,9 @@ class SpotifyPlugin(MetadataSourcePlugin, BeetsPlugin):
|
||||||
elif e.response.status_code == 503:
|
elif e.response.status_code == 503:
|
||||||
self._log.error("Service Unavailable.")
|
self._log.error("Service Unavailable.")
|
||||||
raise SpotifyAPIError("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:
|
elif e.response is not None:
|
||||||
raise SpotifyAPIError(
|
raise SpotifyAPIError(
|
||||||
f"{self.data_source} API error:\n{e.response.text}\n"
|
f"{self.data_source} API error:\n{e.response.text}\n"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue