Skip to content

Commit

Permalink
Add ValidationExprError
Browse files Browse the repository at this point in the history
  • Loading branch information
generalmimon committed May 21, 2020
1 parent 7a0ec98 commit 4b97420
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 @@ -487,3 +487,12 @@ class ValidationNotAnyOfError(ValidationFailedError):
def __init__(self, actual, io, src_path):
super(ValidationNotAnyOfError, self).__init__("not any of the list, 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.
"""
def __init__(self, actual, io, src_path):
super(ValidationExprError, self).__init__("not matching the expression, got %s" % (repr(actual)), io, src_path)
self.actual = actual

0 comments on commit 4b97420

Please sign in to comment.