From 563d05cdfd1b36aa93485d96fd51edb988d5954d Mon Sep 17 00:00:00 2001 From: lordwelch Date: Thu, 19 May 2022 20:13:59 -0700 Subject: [PATCH] Fix crash on startup Add publishers.json to pip package Add exception handling to prevent crash --- comicapi/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/comicapi/utils.py b/comicapi/utils.py index 5ccfba0..b4e19af 100644 --- a/comicapi/utils.py +++ b/comicapi/utils.py @@ -275,4 +275,7 @@ publishers: dict[str, ImprintDict] = {} def load_publishers() -> None: - update_publishers(json.loads((pathlib.Path(__file__).parent / "data" / "publishers.json").read_text("utf-8"))) + try: + update_publishers(json.loads((pathlib.Path(__file__).parent / "data" / "publishers.json").read_text("utf-8"))) + except Exception: + logger.exception("Failed to load publishers.json; The are no publishers or imprints loaded")