Add error message to the error report so we know why the AMQP server is unreachable
This commit is contained in:
@@ -91,12 +91,13 @@ class Consumer(messaging.Consumer):
|
|||||||
super(Consumer, self).__init__(*args, **kwargs)
|
super(Consumer, self).__init__(*args, **kwargs)
|
||||||
self.failed_connection = False
|
self.failed_connection = False
|
||||||
break
|
break
|
||||||
except: # Catching all because carrot sucks
|
except Exception as e: # Catching all because carrot sucks
|
||||||
fl_host = FLAGS.rabbit_host
|
fl_host = FLAGS.rabbit_host
|
||||||
fl_port = FLAGS.rabbit_port
|
fl_port = FLAGS.rabbit_port
|
||||||
fl_intv = FLAGS.rabbit_retry_interval
|
fl_intv = FLAGS.rabbit_retry_interval
|
||||||
LOG.error(_("AMQP server on %(fl_host)s:%(fl_port)d is"
|
LOG.error(_("AMQP server on %(fl_host)s:%(fl_port)d is"
|
||||||
" unreachable. Trying again in %(fl_intv)d seconds.")
|
" unreachable: %(e)s. Trying again in %(fl_intv)d"
|
||||||
|
" seconds.")
|
||||||
% locals())
|
% locals())
|
||||||
self.failed_connection = True
|
self.failed_connection = True
|
||||||
if self.failed_connection:
|
if self.failed_connection:
|
||||||
|
Reference in New Issue
Block a user