add try/except in newsblur.chart.py so a bad request doesn't break all the monitors

This commit is contained in:
Jonathan Math 2021-04-12 14:45:22 -05:00
parent 441dbe6b17
commit 0368bbcdb7

View file

@ -14,8 +14,11 @@ else:
def call_monitor(endpoint):
uri = MONITOR_URL + endpoint
res = requests.get(uri, verify=verify)
return res.json()
try:
return res.json()
except:
return {}
class Service(SimpleService):
def __init__(self, configuration=None, name=None):
SimpleService.__init__(self, configuration=configuration, name=name)