diff options
Diffstat (limited to 'lib/python')
-rw-r--r-- | lib/python/qmk/info.py | 2 | ||||
-rw-r--r-- | lib/python/qmk/json_schema.py | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/python/qmk/info.py b/lib/python/qmk/info.py index bcb4d81ef..7f9907a50 100644 --- a/lib/python/qmk/info.py +++ b/lib/python/qmk/info.py | |||
@@ -74,7 +74,7 @@ def info_json(keyboard): | |||
74 | except jsonschema.ValidationError as e: | 74 | except jsonschema.ValidationError as e: |
75 | json_path = '.'.join([str(p) for p in e.absolute_path]) | 75 | json_path = '.'.join([str(p) for p in e.absolute_path]) |
76 | cli.log.error('Invalid API data: %s: %s: %s', keyboard, json_path, e.message) | 76 | cli.log.error('Invalid API data: %s: %s: %s', keyboard, json_path, e.message) |
77 | exit() | 77 | exit(1) |
78 | 78 | ||
79 | # Make sure we have at least one layout | 79 | # Make sure we have at least one layout |
80 | if not info_data.get('layouts'): | 80 | if not info_data.get('layouts'): |
diff --git a/lib/python/qmk/json_schema.py b/lib/python/qmk/json_schema.py index 3e5663a29..cbc5bff51 100644 --- a/lib/python/qmk/json_schema.py +++ b/lib/python/qmk/json_schema.py | |||
@@ -17,9 +17,12 @@ def json_load(json_file): | |||
17 | try: | 17 | try: |
18 | return hjson.load(json_file.open(encoding='utf-8')) | 18 | return hjson.load(json_file.open(encoding='utf-8')) |
19 | 19 | ||
20 | except json.decoder.JSONDecodeError as e: | 20 | except (json.decoder.JSONDecodeError, hjson.HjsonDecodeError) as e: |
21 | cli.log.error('Invalid JSON encountered attempting to load {fg_cyan}%s{fg_reset}:\n\t{fg_red}%s', json_file, e) | 21 | cli.log.error('Invalid JSON encountered attempting to load {fg_cyan}%s{fg_reset}:\n\t{fg_red}%s', json_file, e) |
22 | exit(1) | 22 | exit(1) |
23 | except Exception as e: | ||
24 | cli.log.error('Unknown error attempting to load {fg_cyan}%s{fg_reset}:\n\t{fg_red}%s', json_file, e) | ||
25 | exit(1) | ||
23 | 26 | ||
24 | 27 | ||
25 | def load_jsonschema(schema_name): | 28 | def load_jsonschema(schema_name): |