Skip to content

Commit e49ea35

Browse files
committed
Clarify error on token_refresh AuthenticationError
1 parent 98449a1 commit e49ea35

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tidalapi/session.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -739,8 +739,9 @@ def token_refresh(self, refresh_token: str) -> bool:
739739
request = self.request_session.post(url, params)
740740
json = request.json()
741741
if request.status_code != 200:
742-
raise AuthenticationError("Authentication failed")
743-
# raise AuthenticationError(Authentication failed json["error"], json["error_description"])
742+
raise AuthenticationError(
743+
f"Authentication failed with error '{json['error']}: {json['error_description']}'"
744+
)
744745
if not request.ok:
745746
log.warning("The refresh token has expired, a new login is required.")
746747
return False

0 commit comments

Comments
 (0)