events: fix error when slack notification request failed without a response

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-07-09 19:52:19 +02:00
parent ec254d5927
commit 3c0cc27ea1

View file

@ -313,7 +313,8 @@ class NotificationTransport(models.Model):
response = post(self.webhook_url, json=body) response = post(self.webhook_url, json=body)
response.raise_for_status() response.raise_for_status()
except RequestException as exc: 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 [ return [
response.status_code, response.status_code,
response.text, response.text,