From 63305fe2329306fdbb28411a6b3314dc04fb2592 Mon Sep 17 00:00:00 2001 From: Jeremy Baxter Date: Fri, 13 Mar 2026 15:35:53 +0000 Subject: [PATCH] check for errors from http.Post --- webhook.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/webhook.go b/webhook.go index 3f9b697..773dca6 100644 --- a/webhook.go +++ b/webhook.go @@ -48,6 +48,10 @@ func Execute(suffix, username, title, text string) (err error) { resp, err := http.Post(baseURL + suffix, "application/json", strings.NewReader(string(body))) + if err != nil { + return + } + if resp.StatusCode < 200 || resp.StatusCode > 299 { err = errors.New(resp.Status) }