From 12fb99bcf8980b646ecd11bdedd96bae9dd2fc8e Mon Sep 17 00:00:00 2001 From: Aaron Bieber Date: Mon, 22 Apr 2024 13:16:36 -0600 Subject: [PATCH] print errors when we can not grok the json --- got.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/got.go b/got.go index 44e1cfd..9b4f2d4 100644 --- a/got.go +++ b/got.go @@ -95,13 +95,15 @@ func gotListen(store *FStore, cli *gomatrix.Client) { dec := json.NewDecoder(r.Body) err = dec.Decode(&gn) if err != nil { - http.Error(w, "invalid data sent to server", http.StatusBadRequest) + log.Printf("GOT: invalid data sent to server: '%s'\n", err) + http.Error(w, fmt.Sprintf("invalid data sent to server: %s", err), http.StatusBadRequest) return } for _, line := range gn.Notifications { log.Printf("GOT: sending '%s'\n", line.String()) err = plugins.SendUnescNotice(cli, gotRoom, line.String()) if err != nil { + log.Printf("GOT: error sending commit info: '%s'\n", err) http.Error( w, fmt.Sprintf("can not send commit info: %s", err),