Skip to content

Commit b54805c

Browse files
committed
Add ValidationNotAnyOfError
1 parent 830b5ec commit b54805c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

kaitaistruct.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,3 +456,11 @@ def __init__(self, max, actual, io, src_path):
456456
super(ValidationGreaterThanError, self).__init__("not in range, max %s, but got %s" % (repr(max), repr(actual)), io, src_path)
457457
self.max = max
458458
self.actual = actual
459+
460+
class ValidationNotAnyOfError(ValidationFailedError):
461+
"""Signals validation failure: we required "actual" value to be
462+
from the list, but it turned out that it's not.
463+
"""
464+
def __init__(self, actual, io, src_path):
465+
super(ValidationNotAnyOfError, self).__init__("not any of the list, got %s" % (repr(actual)), io, src_path)
466+
self.actual = actual

0 commit comments

Comments
 (0)