Skip to content

Commit 5b0b019

Browse files
authored
Validation fix. Must raise exception when raise_ex is true and record class (#107)
doesn't match expectation.
1 parent 424ad78 commit 5b0b019

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

schema_salad/validate.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,11 @@ def validate_ex(expected_schema, # type: Schema
250250
else:
251251
return False
252252
if expected_schema.name != d:
253-
return False
253+
if raise_ex:
254+
raise ValidationException(
255+
u"Expected class '%s' but this is '%s'" % (expected_schema.name, d))
256+
else:
257+
return False
254258
classmatch = d
255259
break
256260

0 commit comments

Comments
 (0)