Skip to content

Commit

Permalink
Debugging KeyError
Browse files Browse the repository at this point in the history
  • Loading branch information
novatorem committed Sep 11, 2020
1 parent 7a8d21a commit 44c9ec1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions api/spotify.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit 44c9ec1

Please sign in to comment.