From 5353570475a9f4312a43b7a95799ac810f3302ef Mon Sep 17 00:00:00 2001 From: Steve Date: Thu, 2 Jun 2022 13:34:30 -0400 Subject: [PATCH] error handling --- main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 7773487..daf17e5 100644 --- a/main.go +++ b/main.go @@ -81,19 +81,19 @@ func notify(ptch patch, url string) { payloadBytes, err := json.Marshal(data) if err != nil { - // handle err + log.Fatalf("Can't create webhook notice; failing since that means drastic data format change") } body := bytes.NewReader(payloadBytes) req, err := http.NewRequest("POST", url, body) if err != nil { - // handle err + log.Fatalf("Either POST was mispelled or couldn't create a context") } req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { - // handle err + log.Println("error posting to webhook") } defer resp.Body.Close() }