Skip to content

Commit

Permalink
Report file when json isn't parsable [DO NOT MERGE]
Browse files Browse the repository at this point in the history
  • Loading branch information
jon-turney committed Jun 22, 2021
1 parent 3c32fe2 commit 971953e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion run_project_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,11 @@ def load_test_json(t: TestDef, stdout_mandatory: bool, mesonenv: environment.Env
test_def = {}
test_def_file = t.path / 'test.json'
if test_def_file.is_file():
test_def = json.loads(test_def_file.read_text())
try:
test_def = json.loads(test_def_file.read_text())
except json.decoder.JSONDecodeError:
print(f'while reading {test_def_file}')
raise

# Handle additional environment variables
env = {} # type: T.Dict[str, str]
Expand Down

0 comments on commit 971953e

Please sign in to comment.