Merge pull request #1887 from mtfurlan/fix/msteams-webhook-status-code

fix(ms teams notifier): handle 202 status code
This commit is contained in:
Sanskar Jaiswal
2026-04-17 11:24:21 +05:30
committed by GitHub
+3 -3
View File
@@ -73,14 +73,14 @@ func postMessage(address, token, proxy string, payload interface{}) error {
res, err := httpClient.Do(req.WithContext(ctx))
if err != nil {
return fmt.Errorf("sending notification failed: %w", err)
return fmt.Errorf("sending notification failed to send: %w", err)
}
defer res.Body.Close()
statusCode := res.StatusCode
if statusCode != 200 {
if statusCode < 200 || 300 <= statusCode {
body, _ := io.ReadAll(res.Body)
return fmt.Errorf("sending notification failed: %s", string(body))
return fmt.Errorf("sending notification bad response %d: %s", statusCode, string(body))
}
return nil