Try/Catch creating connection to CloudWatch

This commit is contained in:
Jimmy Zelinskie 2015-01-16 15:31:40 -05:00
parent 33088f742a
commit fe9e19704b

View file

@ -49,8 +49,12 @@ class SendToCloudWatch(Thread):
self._put_metrics_queue = request_queue
def run(self):
logger.debug('Starting CloudWatch sender process.')
connection = boto.connect_cloudwatch(self._aws_access_key, self._aws_secret_key)
try:
logger.debug('Starting CloudWatch sender process.')
connection = boto.connect_cloudwatch(self._aws_access_key, self._aws_secret_key)
except:
logger.exception('Failed to connect to CloudWatch.')
while True:
put_metric_args, kwargs = self._put_metrics_queue.get()
logger.debug('Got queued put metrics request.')