From be54ba4fe27fc2d1478bf23ccb7a9f3b2551cdac Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Thu, 31 Dec 2020 11:16:17 +0100 Subject: [PATCH] policies: catch error in process to not hang requests --- authentik/policies/process.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/authentik/policies/process.py b/authentik/policies/process.py index c26b63c5d..910fff004 100644 --- a/authentik/policies/process.py +++ b/authentik/policies/process.py @@ -93,4 +93,8 @@ class PolicyProcess(Process): span: Span span.set_data("policy", self.binding.policy) span.set_data("request", self.request) - self.connection.send(self.execute()) + try: + self.connection.send(self.execute()) + except Exception as exc: # pylint: disable=broad-except + LOGGER.warning(exc) + self.connection.send(PolicyResult(False, str(exc)))