From 4a1332290f13aab8cbbcbcd99539b27ac977d680 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sun, 17 Dec 2023 23:42:21 +0100 Subject: [PATCH] handle grpc error Signed-off-by: Jens Langhammer --- authentik/stages/authenticator_mobile/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/authentik/stages/authenticator_mobile/models.py b/authentik/stages/authenticator_mobile/models.py index ba6e17770..5b8a105c1 100644 --- a/authentik/stages/authenticator_mobile/models.py +++ b/authentik/stages/authenticator_mobile/models.py @@ -11,6 +11,7 @@ from django.http import HttpRequest from django.utils.translation import gettext as __ from django.utils.translation import gettext_lazy as _ from django.views import View +from grpc import RpcError from rest_framework.serializers import BaseSerializer, Serializer from structlog.stdlib import get_logger @@ -196,7 +197,7 @@ class MobileTransaction(ExpiringModel): ) ) LOGGER.debug("Sent notification", id=response, tx_id=self.tx_id) - except ValueError as exc: + except (ValueError, RpcError) as exc: LOGGER.warning("failed to push", exc=exc, tx_id=self.tx_id) return True