1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-14 08:17:13 +03:00

CAPI: EDMarketConnector: Don't Session.invalidate() on CredentialsError

This commit is contained in:
Athanasius 2021-08-26 15:13:33 +01:00
parent 885745197c
commit 6c24d9291a
No known key found for this signature in database
GPG Key ID: AE3E527847057C7D
2 changed files with 2 additions and 2 deletions

View File

@ -1109,8 +1109,6 @@ class AppWindow(object):
self.status['text'] = _('Frontier CAPI server error')
except companion.CredentialsError:
# Redirected back to Auth server - force full re-authentication
companion.session.invalidate()
companion.session.retrying = False
companion.session.login()

View File

@ -788,11 +788,13 @@ class Session(object):
# LANG: Frontier CAPI data retrieval failed
raise ServerError(f'{_("Frontier CAPI query failure")}: {capi_endpoint}') from e
# TODO: I don't think this happens any more, it's just a 401 status as above
if r.url.startswith(FRONTIER_AUTH_SERVER):
logger.info('Redirected back to Auth Server')
self.dump(r)
raise CredentialsError('Redirected back to Auth Server')
# TODO: Shouldn't this be covered by raise_for_status() above ?
elif 500 <= r.status_code < 600:
# Server error. Typically 500 "Internal Server Error" if server is down
logger.debug('500 status back from CAPI')