Catch correct error when Spotify has a request error (#43032)

pull/43038/head
Paulus Schoutsen 2020-11-10 09:58:52 +01:00 committed by GitHub
parent 3d4c530dd0
commit 1fba245ff1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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