From 753e4e9a3984a529023fe30ae763f007d6e6e6dc Mon Sep 17 00:00:00 2001 From: Alok Saboo Date: Tue, 28 Nov 2023 09:58:42 -0500 Subject: [PATCH] Add 502 error handling --- beetsplug/spotify.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/beetsplug/spotify.py b/beetsplug/spotify.py index 705209de5..24461194c 100644 --- a/beetsplug/spotify.py +++ b/beetsplug/spotify.py @@ -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"