Skip to content

Commit 497817a

Browse files
committed
Print error messages with line numbers)
1 parent 3afe16c commit 497817a

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

validator/main.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
import fnmatch
21
import json
32
import os
4-
import re
53
from pathlib import Path
64

75
import jsonschema
@@ -39,7 +37,7 @@ def main():
3937
json_file = json.load(vf)
4038
except json.decoder.JSONDecodeError as e:
4139
print('Failed loading JSON file. Check for syntax errors around the mentioned line:')
42-
print(e.msg)
40+
print(e)
4341
failed = True
4442
failed_files.append(f.name)
4543
continue
@@ -49,7 +47,7 @@ def main():
4947
jsonschema.validate(json_file, schema)
5048
except jsonschema.ValidationError as e:
5149
print('Validation failed:')
52-
print(e.message)
50+
print(e)
5351
failed = True
5452
failed_files.append(f.name)
5553
continue

0 commit comments

Comments
 (0)