Skip to content

Commit 4b97420

Browse files
committed
Add ValidationExprError
See kaitai-io/kaitai_struct#435
1 parent 7a0ec98 commit 4b97420

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

kaitaistruct.py

+9
Original file line numberDiff line numberDiff line change
@@ -487,3 +487,12 @@ class ValidationNotAnyOfError(ValidationFailedError):
487487
def __init__(self, actual, io, src_path):
488488
super(ValidationNotAnyOfError, self).__init__("not any of the list, got %s" % (repr(actual)), io, src_path)
489489
self.actual = actual
490+
491+
492+
class ValidationExprError(ValidationFailedError):
493+
"""Signals validation failure: we required "actual" value to match
494+
the expression, but it turned out that it doesn't.
495+
"""
496+
def __init__(self, actual, io, src_path):
497+
super(ValidationExprError, self).__init__("not matching the expression, got %s" % (repr(actual)), io, src_path)
498+
self.actual = actual

0 commit comments

Comments
 (0)