This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
authentik/authentik/policies/exceptions.py
Jens Langhammer 925477b3a2
policies: raise sentry-ignored error for invalid PolicyEngine parameters
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
2023-02-13 13:23:07 +01:00

19 lines
547 B
Python

"""policy exceptions"""
from typing import Optional
from authentik.lib.sentry import SentryIgnoredException
class PolicyEngineException(SentryIgnoredException):
"""Error raised when a policy engine is configured incorrectly"""
class PolicyException(SentryIgnoredException):
"""Exception that should be raised during Policy Evaluation, and can be recovered from."""
src_exc: Optional[Exception] = None
def __init__(self, src_exc: Optional[Exception] = None) -> None:
super().__init__()
self.src_exc = src_exc