diff --git a/pyinfra/queue/queue_manager.py b/pyinfra/queue/queue_manager.py index c961de9..7762ffc 100644 --- a/pyinfra/queue/queue_manager.py +++ b/pyinfra/queue/queue_manager.py @@ -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()