events: prevent error when request fails without response

closes #4589

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Jens Langhammer 2023-02-01 19:39:57 +01:00
parent dbd324f202
commit ffc97905f3
No known key found for this signature in database

View file

@ -361,7 +361,9 @@ class NotificationTransport(SerializerModel):
)
response.raise_for_status()
except RequestException as exc:
raise NotificationTransportError(exc.response.text) from exc
raise NotificationTransportError(
exc.response.text if exc.response else str(exc)
) from exc
return [
response.status_code,
response.text,