mirror of
https://github.com/matrix-org/matrix-spec
synced 2025-12-20 16:38:37 +01:00
Log which file a json parse error occurred in
This commit is contained in:
parent
c49338006a
commit
380f186273
|
|
@ -290,8 +290,14 @@ class MatrixUnits(Units):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
event_type = filename[:-5] # strip the ".json"
|
event_type = filename[:-5] # strip the ".json"
|
||||||
with open(os.path.join(root, filename)) as f:
|
filepath = os.path.join(root, filename)
|
||||||
event_info = json.loads(f.read())
|
with open(filepath) as f:
|
||||||
|
try:
|
||||||
|
event_info = json.load(f)
|
||||||
|
except Exception as e:
|
||||||
|
raise ValueError(
|
||||||
|
"Error reading file %r" % (filepath,), e
|
||||||
|
)
|
||||||
|
|
||||||
if "event" not in event_type:
|
if "event" not in event_type:
|
||||||
continue # filter ImageInfo and co
|
continue # filter ImageInfo and co
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue