Skip to content

Commit

Permalink
Add ValidationNotInEnumError
Browse files Browse the repository at this point in the history
  • Loading branch information
generalmimon committed Aug 19, 2024
1 parent 9bdaeb3 commit b5d9b98
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions kaitaistruct.py
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,15 @@ def __init__(self, actual, io, src_path):
self.actual = actual


class ValidationNotInEnumError(ValidationFailedError):
"""Signals validation failure: we required "actual" value to be in
the enum, but it turned out that it's not.
"""
def __init__(self, actual, io, src_path):
super(ValidationNotInEnumError, self).__init__("not in the enum, got %s" % (repr(actual)), io, src_path)
self.actual = actual


class ValidationExprError(ValidationFailedError):
"""Signals validation failure: we required "actual" value to match
the expression, but it turned out that it doesn't.
Expand Down

0 comments on commit b5d9b98

Please sign in to comment.