diff --git a/src/daq/alert/alert_slack.py b/src/daq/alert/alert_slack.py index e19ede4..c81be5a 100644 --- a/src/daq/alert/alert_slack.py +++ b/src/daq/alert/alert_slack.py @@ -35,7 +35,7 @@ def send_webhook(self, alert: DAQJobMessageAlert): f"Sending alert to Slack: [{alert.alert_info.severity}] {alert.alert_info.message}" ) assert alert.daq_job_info is not None - self._slack.post( + res = self._slack.post( attachments=[ { "fallback": alert.alert_info.message, @@ -62,3 +62,5 @@ def send_webhook(self, alert: DAQJobMessageAlert): } ] ) + if res != "ok": + raise Exception("Slack webhook returned error!")