From e7375e5ee0941752bed48b642bc06fa913f0fcc2 Mon Sep 17 00:00:00 2001 From: Mara Furland Date: Fri, 13 Mar 2026 13:09:32 -0400 Subject: [PATCH] fix(ms teams notifier): handle 202 status code teams returns a 202 Accepted for webhooks, but flagger was marking this as an error. Signed-off-by: Mara Furland --- pkg/notifier/client.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/notifier/client.go b/pkg/notifier/client.go index 1e6d622c..86449672 100644 --- a/pkg/notifier/client.go +++ b/pkg/notifier/client.go @@ -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