If something expected happens than it should not be logged as ERROR

This commit is contained in:
Pünkösd Marcell 2020-04-22 03:41:35 +02:00
parent ad44b4f134
commit 00300f5b2f
1 changed files with 4 additions and 3 deletions

View File

@ -57,7 +57,8 @@ class Communicator:
LOGGER.info(f"List of currently available consumers: {json}")
return json
except Exception as e:
LOGGER.exception(e)
LOGGER.error("Could not query available consumer list!")
#LOGGER.exception(e)
return []
def isconsumeravailable(self) -> bool:
@ -70,7 +71,7 @@ class Communicator:
response = requests.get(f'http://{currentconsumer}/consumers', timeout=5)
isavailable = response.status_code == 200
except Exception as e:
LOGGER.exception(e)
#LOGGER.exception(e)
isavailable = False
LOGGER.info(f"Current consumer availability: {isavailable}")
return isavailable
@ -85,7 +86,7 @@ class Communicator:
response = requests.get(f'http://{consumer}/consumers', timeout=5)
isavailable = response.status_code == 200
except Exception as e:
LOGGER.exception(e)
#LOGGER.exception(e)
isavailable = False
LOGGER.info(f"Consumer {consumer} availability: {isavailable}")
return isavailable