Skip to content

Commit

Permalink
Add more error logging points
Browse files Browse the repository at this point in the history
  • Loading branch information
MCMi460 committed Sep 20, 2022
1 parent e2409dd commit a9c084f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions client/api/__init__.py
Expand Up @@ -113,7 +113,8 @@ def updateLogin(self):
try:
self.headers['Authorization'] = 'Bearer %s' % self.login['login'].account['result'].get('webApiServerCredential').get('accessToken')
except Exception as e:
raise Exception('Failure with authorization: %s\nLogin returns %s' % (e, self.login['login'].account))
log('Failure with authorization: %s\nLogin returns %s' % (e, self.login['login'].account))
raise e
log('Login from file')
if time.time() - self.login['time'] < 7170:
return
Expand Down Expand Up @@ -298,7 +299,11 @@ def __init__(self):

def populateList(self, API:API):
response = API.makeRequest(self.route)
arr = json.loads(response.text)['result']['friends']
try:
arr = json.loads(response.text)['result']['friends']
except Exception as e:
log('Failure with authorization: %s\Friends returns %s' % (e, response.text))
raise e
self.friendList = [ Friend(friend) for friend in arr ]

class Presence():
Expand Down

0 comments on commit a9c084f

Please sign in to comment.