Skip to content

Commit

Permalink
feat: raise if Slack API fails in DAQJobAlertSlack
Browse files Browse the repository at this point in the history
  • Loading branch information
furkan-bilgin committed Nov 13, 2024
1 parent 41ed6a2 commit 308c0f2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/daq/alert/alert_slack.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -62,3 +62,5 @@ def send_webhook(self, alert: DAQJobMessageAlert):
}
]
)
if res != "ok":
raise Exception("Slack webhook returned error!")

0 comments on commit 308c0f2

Please sign in to comment.