summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlok Saboo <arsaboo@gmx.com>2023-12-04 10:32:55 -0500
committerAlok Saboo <arsaboo@gmx.com>2023-12-04 10:32:55 -0500
commitc102505621f934275ff977801a26fdf0a27e34fa (patch)
treed05bb7dd8cc0f3adb11729460b092cc8600b299b
parent951b0f576329cbf5d3646036b7e0602156024d05 (diff)
Add ConnectionError handling
-rw-r--r--beetsplug/spotify.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/beetsplug/spotify.py b/beetsplug/spotify.py
index 24461194c..a825ef35a 100644
--- a/beetsplug/spotify.py
+++ b/beetsplug/spotify.py
@@ -184,6 +184,9 @@ class SpotifyPlugin(MetadataSourcePlugin, BeetsPlugin):
except requests.exceptions.ReadTimeout:
self._log.error("ReadTimeout.")
raise SpotifyAPIError("Request timed out.")
+ except requests.exceptions.ConnectionError as e:
+ self._log.error(f"Network error: {e}")
+ raise SpotifyAPIError("Network error.")
except requests.exceptions.RequestException as e:
if e.response.status_code == 401:
self._log.debug(