Commit 99615244 authored by Samuel GAIST's avatar Samuel GAIST

[schema] Print the JSON content on decoding error

parent 459b3393
......@@ -94,7 +94,11 @@ def load_schema(schema_name, version=1):
with open(fname, "rb") as f:
data = f.read().decode()
schema = json.loads(data)
try:
schema = json.loads(data)
except json.errors.JSONDecodeError:
print("Invalid json:\n {data}".format(data))
raise
basedir = os.path.realpath(os.path.dirname(fname))
resolver = jsonschema.RefResolver("file://" + basedir + "/", schema)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment