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( diff --git a/docs/changelog.rst b/docs/changelog.rst index 8266e8550..3872db865 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -148,6 +148,7 @@ New features: Bug fixes: +* :doc:`/plugins/spotify`: Improve handling of ConnectionError. * :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.