fix potential exception

This commit is contained in:
Martin Konecny 2012-07-11 10:39:23 -04:00
parent 82d4ee09ae
commit bed2a0731b
2 changed files with 6 additions and 1 deletions

View file

@ -452,7 +452,7 @@ class AirTimeApiClient(ApiClientInterface):
response = self.get_response_from_server(url)
response = json.loads(response)
except Exception, e:
response = None
response = {}
logger.error("Exception: %s", e)
return response

View file

@ -38,6 +38,11 @@ class AirtimeNotifier(Notifier):
time.sleep(5)
def init_rabbit_mq(self):
"""
This function will attempt to connect to RabbitMQ Server and if successful
return 'True'. Returns 'False' otherwise.
"""
self.logger.info("Initializing RabbitMQ stuff")
try:
schedule_exchange = Exchange("airtime-media-monitor", "direct", durable=True, auto_delete=True)