diff --git a/aurweb/exceptions.py b/aurweb/exceptions.py index 31212676..1c45b7f3 100644 --- a/aurweb/exceptions.py +++ b/aurweb/exceptions.py @@ -86,3 +86,7 @@ class ValidationError(AurwebException): def __init__(self, data: Any, *args, **kwargs): super().__init__(*args, **kwargs) self.data = data + + +class InvariantError(AurwebException): + pass diff --git a/test/test_exceptions.py b/test/test_exceptions.py index 7247106b..e43cd645 100644 --- a/test/test_exceptions.py +++ b/test/test_exceptions.py @@ -97,3 +97,10 @@ def test_repository_name_exception(): raise exceptions.InvalidRepositoryNameException("test") except exceptions.InvalidRepositoryNameException as exc: assert str(exc) == "invalid repository name: test" + + +def test_invariant_error(): + try: + raise exceptions.InvariantError("test") + except exceptions.InvariantError as exc: + assert str(exc) == "test"