Skip to content

Commit

Permalink
Better trapping of schema validation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
upibhalla committed Oct 21, 2023
1 parent fe70cff commit 9d67c8c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion findSim.py
Original file line number Diff line number Diff line change
Expand Up @@ -1395,7 +1395,11 @@ def loadJson( fname, mapFile ):

with open( fs ) as _schema:
schema = json.load( _schema )
jsonschema.validate( findsim, schema )
try:
jsonschema.validate( findsim, schema )
except jsonschema.exceptions.ValidationError:
print( "Failed to validate findSim file {}".format( fname ) )
raise
expt = Experiment( findsim["Metadata"], findsim["Experiment"] )
stims = Stimulus.load( findsim ) # Stimuli are an optional argument
readouts = Readout( findsim )
Expand Down

0 comments on commit 9d67c8c

Please sign in to comment.