Skip to content
This repository was archived by the owner on Jun 11, 2025. It is now read-only.

Commit 85f0ec5

Browse files
committed
Use consistent arguments in generic API exceptions
1 parent 7f582a1 commit 85f0ec5

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

skpy/conn.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -584,10 +584,11 @@ def auth(self, user, pwd):
584584
"""
585585
# Wrap up the credentials ready to send.
586586
pwdHash = base64.b64encode(hashlib.md5((user + "\nskyper\n" + pwd).encode("utf-8")).digest()).decode("utf-8")
587-
json = self.conn("POST", "{0}/login/skypetoken".format(SkypeConnection.API_USER),
588-
json={"username": user, "passwordHash": pwdHash, "scopes": "client"}).json()
587+
resp = self.conn("POST", "{0}/login/skypetoken".format(SkypeConnection.API_USER),
588+
json={"username": user, "passwordHash": pwdHash, "scopes": "client"})
589+
json = resp.json()
589590
if "skypetoken" not in json:
590-
raise SkypeAuthException("Couldn't retrieve Skype token from response")
591+
raise SkypeAuthException("Couldn't retrieve Skype token from response", resp)
591592
expiry = None
592593
if "expiresIn" in json:
593594
expiry = datetime.fromtimestamp(int(time.time()) + int(json["expiresIn"]))

skpy/core.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,7 @@ class SkypeAuthException(SkypeException):
245245
"""
246246
An exception thrown when authentication cannot be completed.
247247
248-
Arguments will usually be of the form (``message``, ``response``). If the server provided an error message, it
249-
will be present in a third argument.
248+
Arguments will be of the form (``message``, ``response``).
250249
251250
Unfortunately there are many possible reasons why a login may be rejected, including but not limited to:
252251

0 commit comments

Comments
 (0)