handle URL Errors
parent
dc7e614e0f
commit
d914aaa8cb
|
@ -40,7 +40,12 @@ class CustomCollector(object):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def collect(self):
|
def collect(self):
|
||||||
|
try:
|
||||||
stats = json.loads(urlopen(self.stats_url).read())
|
stats = json.loads(urlopen(self.stats_url).read())
|
||||||
|
except error.URLError as e:
|
||||||
|
logging.error("URLError while opening Frigate stats url %s: %s", self.stats_url, e)
|
||||||
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.process_stats = stats['cpu_usages']
|
self.process_stats = stats['cpu_usages']
|
||||||
except KeyError:
|
except KeyError:
|
||||||
|
|
Loading…
Reference in New Issue