Skip to content

Commit 47012ac

Browse files
author
Joseph Sirianni
committed
check error before logging that an alert was sent
1 parent 0f69956 commit 47012ac

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

disk-usage.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,13 @@ func slackAlert(m string) error {
8787
Channel: globalConfig.Slack.Channel,
8888
URL: globalConfig.Slack.Url,
8989
}
90+
91+
if err := alert.Send(); err != nil {
92+
return err
93+
}
94+
9095
log.Info("slack alert sent: " + m)
91-
return alert.Send()
96+
return nil
9297
}
9398

9499
func handleLock(createLock, createAlert bool, message string) error {

0 commit comments

Comments
 (0)