Debugging KeyError

This commit is contained in:
novatorem
2020-09-11 17:18:40 -04:00
parent 7a8d21a969
commit 44c9ec100b

View File

@@ -38,9 +38,14 @@ def refreshToken():
}
headers = {"Authorization": "Basic {}".format(getAuth())}
response = requests.post(REFRESH_TOKEN_URL, data=data, headers=headers)
try:
return response.json()["access_token"]
except KeyError:
print(json.dumps(response.json()))
print("\n---\n")
raise KeyError(str(response.json()))
def recentlyPlayed():