handle errors in json files

This commit is contained in:
Jakob Ketterl
2019-12-15 17:44:31 +01:00
parent ef1435cef7
commit 0e8116b743
2 changed files with 10 additions and 0 deletions

View File

@ -57,6 +57,9 @@ class Bandplan(object):
return [Band(d) for d in bands_json]
except FileNotFoundError:
pass
except json.JSONDecodeError:
logger.exception("error while parsing bandplan from %s", file)
return []
return []
def findBands(self, freq):