Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
beat
beat.core
Commits
99615244
Commit
99615244
authored
Apr 12, 2019
by
Samuel GAIST
Browse files
[schema] Print the JSON content on decoding error
parent
459b3393
Changes
1
Hide whitespace changes
Inline
Side-by-side
beat/core/schema/__init__.py
View file @
99615244
...
...
@@ -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
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment