mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-14 08:17:13 +03:00
CAPI: Add retry of request after refreshing Access Token
This commit is contained in:
parent
8e32ecd216
commit
7a52ddd278
@ -1165,6 +1165,8 @@ class AppWindow(object):
|
||||
if companion.session.login():
|
||||
logger.debug('Initial query failed, but login() just worked, trying again...')
|
||||
companion.session.retrying = True
|
||||
self.w.after(int(SERVER_RETRY * 1000), lambda: self.capi_request_data(event))
|
||||
return # early exit to avoid starting cooldown count
|
||||
|
||||
except companion.CredentialsError:
|
||||
companion.session.retrying = False
|
||||
|
@ -784,7 +784,7 @@ class Session(object):
|
||||
# TODO: This needs to try a REFRESH, not a full re-auth
|
||||
# No need for translation, we'll go straight into trying new Auth
|
||||
# and thus any message would be overwritten.
|
||||
raise CredentialsError('Frontier CAPI said Auth required') from e
|
||||
raise CredentialsRequireRefresh('Frontier CAPI said "unauthorized"') from e
|
||||
|
||||
if r.status_code == 418: # "I'm a teapot" - used to signal maintenance
|
||||
# LANG: Frontier CAPI returned 418, meaning down for maintenance
|
||||
|
Loading…
x
Reference in New Issue
Block a user