From 1fba245ff1d43c9e104f15450b544353efd8167d Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Tue, 10 Nov 2020 09:58:52 +0100 Subject: [PATCH] Catch correct error when Spotify has a request error (#43032) --- homeassistant/components/spotify/media_player.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/spotify/media_player.py b/homeassistant/components/spotify/media_player.py index 06b9d55536c..5f376493c65 100644 --- a/homeassistant/components/spotify/media_player.py +++ b/homeassistant/components/spotify/media_player.py @@ -5,7 +5,7 @@ from datetime import timedelta import logging from typing import Any, Callable, Dict, List, Optional -from aiohttp import ClientError +import requests from spotipy import Spotify, SpotifyException from yarl import URL @@ -195,7 +195,7 @@ def spotify_exception_handler(func): result = func(self, *args, **kwargs) self.player_available = True return result - except (SpotifyException, ClientError): + except (SpotifyException, requests.RequestException): self.player_available = False return wrapper