RED-4653: Corrected exception block to not swallow exceptions

This commit is contained in:
Viktor Seifert 2022-08-01 13:17:01 +02:00
parent 5cdf4df4a3
commit bbf013385a

View File

@ -67,14 +67,16 @@ class QueueManager(object):
self.logger.info("Consuming from queue")
self._consumer_token = None
try:
self._consumer_token = self._channel.basic_consume(self._input_queue, callback)
self.logger.info(f"Registered with consumer-tag: {self._consumer_token}")
self._channel.start_consuming()
except Exception as ex:
except Exception:
self.logger.warning(
f"An unexpected exception occurred while consuming messages. Consuming will stop.\n{ex}"
f"An unexpected exception occurred while consuming messages. Consuming will stop."
)
raise
finally:
self.stop_consuming()