Skip to content

Commit

Permalink
make json imports more robust (qmk#13928)
Browse files Browse the repository at this point in the history
  • Loading branch information
skullydazed authored Aug 9, 2021
1 parent 79d5b27 commit 5eb0e40
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/python/qmk/json_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 5eb0e40

Please sign in to comment.