mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-06-09 11:52:27 +03:00
companion.py: Move check for CAPI pretend down
This commit is contained in:
parent
8d6fae6ef6
commit
e6c6f7f155
@ -564,11 +564,11 @@ class Session(object):
|
|||||||
logger.error('cannot make a query when unauthorized')
|
logger.error('cannot make a query when unauthorized')
|
||||||
raise CredentialsError('cannot make a query when unauthorized')
|
raise CredentialsError('cannot make a query when unauthorized')
|
||||||
|
|
||||||
try:
|
logger.trace_if('capi.query', 'Trying...')
|
||||||
logger.trace_if('capi.query', 'Trying...')
|
if conf_module.capi_pretend_down:
|
||||||
if conf_module.capi_pretend_down:
|
raise ServerConnectionError(f'Pretending CAPI down: {endpoint}')
|
||||||
raise ServerConnectionError(f'Pretending CAPI down: {endpoint}')
|
|
||||||
|
|
||||||
|
try:
|
||||||
r = self.session.get(self.server + endpoint, timeout=timeout) # type: ignore
|
r = self.session.get(self.server + endpoint, timeout=timeout) # type: ignore
|
||||||
|
|
||||||
except requests.ConnectionError as e:
|
except requests.ConnectionError as e:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user