~ruther/qmk_firmware

5eb0e406fdc6e0612db18ea5bde93f98c215808d — Zach White 4 years ago 79d5b27
make json imports more robust (#13928)

1 files changed, 4 insertions(+), 1 deletions(-)

M lib/python/qmk/json_schema.py
M lib/python/qmk/json_schema.py => lib/python/qmk/json_schema.py +4 -1
@@ 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):