From 8036758857dc67d126676e79a10024fe98209c94 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Sat, 1 Feb 2020 21:37:43 +0100 Subject: [PATCH] improve error handling on band and bookmark loading --- owrx/bands.py | 5 ++++- owrx/bookmarks.py | 5 ++++- owrx/config.py | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/owrx/bands.py b/owrx/bands.py index cf2bd7c..fbb7ae6 100644 --- a/owrx/bands.py +++ b/owrx/bands.py @@ -58,7 +58,10 @@ class Bandplan(object): except FileNotFoundError: pass except json.JSONDecodeError: - logger.exception("error while parsing bandplan from %s", file) + logger.exception("error while parsing bandplan file %s", file) + return [] + except Exception: + logger.exception("error while processing bandplan from %s", file) return [] return [] diff --git a/owrx/bookmarks.py b/owrx/bookmarks.py index 1456c8f..d5a38d8 100644 --- a/owrx/bookmarks.py +++ b/owrx/bookmarks.py @@ -50,7 +50,10 @@ class Bookmarks(object): except FileNotFoundError: pass except json.JSONDecodeError: - logger.exception("error while parsing bookmarks from %s", file) + logger.exception("error while parsing bookmarks file %s", file) + return [] + except Exception: + logger.exception("error while processing bookmarks from %s", file) return [] return [] diff --git a/owrx/config.py b/owrx/config.py index 820fee8..09bbd8f 100644 --- a/owrx/config.py +++ b/owrx/config.py @@ -145,5 +145,5 @@ class PropertyManager(object): self[name] = value return self except FileNotFoundError: - logger.debug("not found: %s", file) + pass raise ConfigNotFoundException("no usable config found! please make sure you have a valid configuration file!")