refactor handle_reponse
@@ -396,12 +396,15 @@ class SpotifyPlugin(MetadataSourcePlugin, BeetsPlugin):
self._log.debug(
f"Searching {self.data_source} for '{query}'"
)
- response_data = (
- self._handle_response(
+ try:
+ response = self._handle_response(
requests.get,
self.search_url,
params={'q': query, 'type': query_type},
)
+ except SpotifyAPIError as e:
+ self._log.debug('Spotify API error: {}', e)
+ response_data = (response
.get(query_type + 's', {})
.get('items', [])
)
