fix potential exception
This commit is contained in:
parent
82d4ee09ae
commit
bed2a0731b
2 changed files with 6 additions and 1 deletions
|
@ -452,7 +452,7 @@ class AirTimeApiClient(ApiClientInterface):
|
||||||
response = self.get_response_from_server(url)
|
response = self.get_response_from_server(url)
|
||||||
response = json.loads(response)
|
response = json.loads(response)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
response = None
|
response = {}
|
||||||
logger.error("Exception: %s", e)
|
logger.error("Exception: %s", e)
|
||||||
|
|
||||||
return response
|
return response
|
||||||
|
|
|
@ -38,6 +38,11 @@ class AirtimeNotifier(Notifier):
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
|
|
||||||
def init_rabbit_mq(self):
|
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")
|
self.logger.info("Initializing RabbitMQ stuff")
|
||||||
try:
|
try:
|
||||||
schedule_exchange = Exchange("airtime-media-monitor", "direct", durable=True, auto_delete=True)
|
schedule_exchange = Exchange("airtime-media-monitor", "direct", durable=True, auto_delete=True)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue