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
1 changed files with 3 additions and 1 deletions

View File

@ -361,7 +361,9 @@ class NotificationTransport(SerializerModel):
) )
response.raise_for_status() response.raise_for_status()
except RequestException as exc: 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 [ return [
response.status_code, response.status_code,
response.text, response.text,