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

View File

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