diff --git a/api/spotify.py b/api/spotify.py index 66cd1a0a..d0abdd1a 100644 --- a/api/spotify.py +++ b/api/spotify.py @@ -38,9 +38,14 @@ def refreshToken(): } headers = {"Authorization": "Basic {}".format(getAuth())} - response = requests.post(REFRESH_TOKEN_URL, data=data, headers=headers) - return response.json()["access_token"] + + try: + return response.json()["access_token"] + except KeyError: + print(json.dumps(response.json())) + print("\n---\n") + raise KeyError(str(response.json())) def recentlyPlayed():