Add error message to the error report so we know why the AMQP server is unreachable

This commit is contained in:
Kevin L. Mitchell 2011-03-25 05:30:36 +00:00
parent c7c3fe8518
commit 4a217b640c
1 changed files with 3 additions and 2 deletions

View File

@ -91,12 +91,13 @@ class Consumer(messaging.Consumer):
super(Consumer, self).__init__(*args, **kwargs)
self.failed_connection = False
break
except: # Catching all because carrot sucks
except Exception as e: # Catching all because carrot sucks
fl_host = FLAGS.rabbit_host
fl_port = FLAGS.rabbit_port
fl_intv = FLAGS.rabbit_retry_interval
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())
self.failed_connection = True
if self.failed_connection: