mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 02:07:09 +00:00
Catch correct error when Spotify has a request error (#43032)
This commit is contained in:
parent
3d4c530dd0
commit
1fba245ff1
@ -5,7 +5,7 @@ from datetime import timedelta
|
|||||||
import logging
|
import logging
|
||||||
from typing import Any, Callable, Dict, List, Optional
|
from typing import Any, Callable, Dict, List, Optional
|
||||||
|
|
||||||
from aiohttp import ClientError
|
import requests
|
||||||
from spotipy import Spotify, SpotifyException
|
from spotipy import Spotify, SpotifyException
|
||||||
from yarl import URL
|
from yarl import URL
|
||||||
|
|
||||||
@ -195,7 +195,7 @@ def spotify_exception_handler(func):
|
|||||||
result = func(self, *args, **kwargs)
|
result = func(self, *args, **kwargs)
|
||||||
self.player_available = True
|
self.player_available = True
|
||||||
return result
|
return result
|
||||||
except (SpotifyException, ClientError):
|
except (SpotifyException, requests.RequestException):
|
||||||
self.player_available = False
|
self.player_available = False
|
||||||
|
|
||||||
return wrapper
|
return wrapper
|
||||||
|
Loading…
x
Reference in New Issue
Block a user