-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add slack channel when logging error. #2177
Conversation
You need to sign your commit.
|
75322df
to
a4335d5
Compare
notify/slack/slack.go
Outdated
return n.retrier.Check(resp.StatusCode, resp.Body) | ||
retry, err := n.retrier.Check(resp.StatusCode, resp.Body) | ||
if err != nil { | ||
err = fmt.Errorf("%v on slack channel: %s", err, req.Channel) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use github.com/pkg/errors
to wrap the error which is a bit shorter:
retry, err := n.retrier.Check(resp.StatusCode, resp.Body)
err = errors.Wrap(err, fmt.Sprintf("channel %q", req.Channel))
return retry, err
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the tip
Signed-off-by: Melchior MOULIN <m.moulin@criteo.com>
a4335d5
to
a945fed
Compare
Is the test failed because of my commit ? |
This is a flake, I've retriggered the test. |
Thanks! |
Add the slack channel when logging error from slack.
#2176