added minimal excpetion handling to communicator.py
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Scharnitzky Donát 2020-04-01 01:02:33 +02:00
parent a784cad088
commit f2c82419c8

View File

@ -43,11 +43,14 @@ class Communicator:
Get the list of available consumer from the current primary consumer. Get the list of available consumer from the current primary consumer.
:return: :return:
""" """
currentconsumer = self.currenctconsumer try:
response = requests.get(f'http://{currentconsumer}/consumer') currentconsumer = self.currenctconsumer
json = response.json() response = requests.get(f'http://{currentconsumer}/consumer')
LOGGER.debug(f"List of currently available consumers: {json}") json = response.json()
return json LOGGER.debug(f"List of currently available consumers: {json}")
return json
except Exception:
return []
def isconsumeravailable(self) -> bool: def isconsumeravailable(self) -> bool:
""" """