Skip to content

Commit 069f3d1

Browse files
committed
improve error logging in Slack alert function
1 parent b8bf588 commit 069f3d1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

anomstack/alerts/slack.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def send_alert_slack(
106106
logger.error(f"Channel {channel_name} not found.")
107107
return
108108
except SlackApiError as e:
109-
logger.error(f"Error fetching channel ID: {e.response['error']}")
109+
logger.error(f"Error fetching channel ID: {e}")
110110
return
111111

112112
try:
@@ -123,7 +123,7 @@ def send_alert_slack(
123123
channel=channel_id, text=f"*{title}*\n{message}"
124124
)
125125
except SlackApiError as e:
126-
logger.error(f"Error sending message to Slack: {e.response['error']}")
126+
logger.error(f"Error sending message to Slack channel {channel_name, channel_id}: {e}")
127127

128128

129129
def send_alert_slack_with_plot(

0 commit comments

Comments
 (0)