-
Notifications
You must be signed in to change notification settings - Fork 144
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
Slack chat.postMessage
errors are not caught
#1048
Comments
@ordovicia are you willing to contribute this fix? The way I see it, we should create an option for that fuction that we can pass at the end of the args through type requestOptFunc func(*retryablehttp.Request) So to pass a boolean or something we would probably need an options struct and modify the function type above to accept both things, something along those lines... |
I will try to contribute to a fix in a few months. |
Hi, I am preparing a fix in #1086 |
postMessage
function assumes that HTTP responses have a meaningful status code (2xx for success, 4xx or 5xx for error).notification-controller/internal/notifier/client.go
Line 103 in 2763e54
Slack
chat.postMessage
API does not satisfy this assumption.https://api.slack.com/methods/chat.postMessage
Seems that it always responds with
200 OK
.ok
anderror
fields in response body JSON indicate an error, if any.Thus, Slack errors are not caught by
postMessage
function, and will not appear in notification-controller logs nor Alert resource Events.The text was updated successfully, but these errors were encountered: