handle grpc error

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Jens Langhammer 2023-12-17 23:42:21 +01:00
parent 02cfc80b9f
commit 4a1332290f
No known key found for this signature in database
1 changed files with 2 additions and 1 deletions

View File

@ -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