From dc56e09914bf34aec183f28d22f32a4a57b8e63c Mon Sep 17 00:00:00 2001 From: Peter Stuifzand Date: Sun, 31 Oct 2021 23:04:49 +0100 Subject: [PATCH] Add logging to micropub --- cmd/eksterd/micropub.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/eksterd/micropub.go b/cmd/eksterd/micropub.go index f73cb9e..4acfb7f 100644 --- a/cmd/eksterd/micropub.go +++ b/cmd/eksterd/micropub.go @@ -63,6 +63,7 @@ func (h *micropubHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { // TODO: We could try to fill the Source of the Item with something, but what? item, err := parseIncomingItem(r) if err != nil { + log.Println(err) http.Error(w, err.Error(), 400) return } @@ -70,6 +71,7 @@ func (h *micropubHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { item.Read = false newID, err := generateItemID(conn, channel) if err != nil { + log.Println(err) http.Error(w, err.Error(), 500) return } @@ -88,6 +90,7 @@ func (h *micropubHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json") if err = json.NewEncoder(w).Encode(map[string]string{"ok": "1"}); err != nil { + log.Println(err) http.Error(w, "internal server error", 500) }