Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Handle imink API being down #142

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions client/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,20 @@ def __init__(self, userInfo, userLang, accessToken, guid):
self.na_id = userInfo['id']

self.imink = imink(self.na_id, self.accessToken, self.timestamp, self.guid, 1).get()
self.timestamp = int(self.imink['timestamp'])
self.guid = self.imink['request_id']

self.account = None
if 'error' in self.imink or self.imink.get('error') is not None:
iminkApiError = (
'Unable to authenticate with imink. \n\n'
'The F Calculation API may be experiencing issues. \n'
'Please check the website for more details: \n'
'https://status.imink.app/ \n'
)
raise RuntimeError(iminkApiError) from None
else:
self.timestamp = int(self.imink['timestamp'])
self.guid = self.imink['request_id']

self.account = None

def loginToAccount(self):
route = '/v3/Account/Login'
Expand Down