diff --git a/beat/core/schema/__init__.py b/beat/core/schema/__init__.py index ae809022eb9a8b3ee7f337259770e44b9794cbdd..d182bf356edc2af58ba47bb9edd5918ceff0bbdf 100644 --- a/beat/core/schema/__init__.py +++ b/beat/core/schema/__init__.py @@ -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)