diff --git a/authentik/events/models.py b/authentik/events/models.py index 904fe06c8..0364e5dd4 100644 --- a/authentik/events/models.py +++ b/authentik/events/models.py @@ -313,7 +313,8 @@ class NotificationTransport(models.Model): response = post(self.webhook_url, json=body) response.raise_for_status() except RequestException as exc: - raise NotificationTransportError(exc.response.text) from exc + text = exc.response.text if exc.response else str(exc) + raise NotificationTransportError(text) from exc return [ response.status_code, response.text,