From 025c9724b5fd72dc179da8ae73397bab53e6c9e1 Mon Sep 17 00:00:00 2001 From: Zach White Date: Sun, 8 Aug 2021 19:27:12 -0700 Subject: [PATCH] make json imports more robust --- lib/python/qmk/json_schema.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/python/qmk/json_schema.py b/lib/python/qmk/json_schema.py index 077dfcaa932..f3992ee71ae 100644 --- a/lib/python/qmk/json_schema.py +++ b/lib/python/qmk/json_schema.py @@ -17,9 +17,12 @@ def json_load(json_file): try: return hjson.load(json_file.open(encoding='utf-8')) - except json.decoder.JSONDecodeError as e: + except (json.decoder.JSONDecodeError, hjson.HjsonDecodeError) as e: cli.log.error('Invalid JSON encountered attempting to load {fg_cyan}%s{fg_reset}:\n\t{fg_red}%s', json_file, e) exit(1) + except Exception as e: + cli.log.error('Unknown error attempting to load {fg_cyan}%s{fg_reset}:\n\t{fg_red}%s', json_file, e) + exit(1) def load_jsonschema(schema_name):