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) }