Skip to content

Commit

Permalink
better error message for slack notifier
Browse files Browse the repository at this point in the history
  • Loading branch information
darkcrux committed Nov 14, 2014
1 parent 958ca60 commit 29ee14e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions notifier/slack-notifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,13 @@ func (slack *SlackNotifier) Notify(messages Messages) bool {
defer res.Body.Close()
statusCode := res.StatusCode
if statusCode != 200 {
body, err := ioutil.ReadAll(res.Body)
log.Println("Unable to notify slack:", body, err)
body, _ := ioutil.ReadAll(res.Body)
log.Println("Unable to notify slack:", string(body))
return false
} else {
log.Println("Slack notification sent.")
return true
}
log.Println("Slack notification sent.")
return true
}

}

0 comments on commit 29ee14e

Please sign in to comment.