Skip to content

Commit 3ab8d24

Browse files
slack: notification error log
The commit improves log during notification error. Signed-off-by: viktor-kurchenko <[email protected]>
1 parent ac657a5 commit 3ab8d24

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/slack/slack.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import (
77
"time"
88
"unicode/utf8"
99

10+
"c7n-helper/pkg/log"
11+
1012
"github.com/slack-go/slack"
1113
)
1214

@@ -162,6 +164,7 @@ func (s *slackProvider) notify(ctx context.Context, channelMessages map[string][
162164
for _, message := range messages {
163165
_, _, _, err := s.client.SendMessageContext(ctx, channel, slack.MsgOptionText(message, false))
164166
if err != nil {
167+
log.FromContext(ctx).Errorf("channel [%s] notification error (check if C7N bot invited!): %s", channel, err)
165168
return err
166169
}
167170
time.Sleep(time.Millisecond * 150) // pause to avoid slack rate limits

0 commit comments

Comments
 (0)