Skip to content

Commit

Permalink
Handle Spotify errors with no message
Browse files Browse the repository at this point in the history
  • Loading branch information
bbye98 committed Dec 1, 2024
1 parent eb574d6 commit 33fb484
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/minim/spotify.py
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,9 @@ def _request(
r = self.session.request(method, url, **kwargs)
if r.status_code not in range(200, 299):
error = r.json()["error"]
emsg = f"{error['status']} {error['message']}"
emsg = f"{error['status']}"
if "message" in error:
emsg += f" {error['message']}"
if r.status_code == 401 and retry:
logging.warning(emsg)
self._refresh_access_token()
Expand Down

0 comments on commit 33fb484

Please sign in to comment.