Add logging to micropub
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
a183b26312
commit
dc56e09914
|
@ -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?
|
// TODO: We could try to fill the Source of the Item with something, but what?
|
||||||
item, err := parseIncomingItem(r)
|
item, err := parseIncomingItem(r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
log.Println(err)
|
||||||
http.Error(w, err.Error(), 400)
|
http.Error(w, err.Error(), 400)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -70,6 +71,7 @@ func (h *micropubHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||||
item.Read = false
|
item.Read = false
|
||||||
newID, err := generateItemID(conn, channel)
|
newID, err := generateItemID(conn, channel)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
log.Println(err)
|
||||||
http.Error(w, err.Error(), 500)
|
http.Error(w, err.Error(), 500)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -88,6 +90,7 @@ func (h *micropubHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||||
w.Header().Set("Content-Type", "application/json")
|
w.Header().Set("Content-Type", "application/json")
|
||||||
|
|
||||||
if err = json.NewEncoder(w).Encode(map[string]string{"ok": "1"}); err != nil {
|
if err = json.NewEncoder(w).Encode(map[string]string{"ok": "1"}); err != nil {
|
||||||
|
log.Println(err)
|
||||||
http.Error(w, "internal server error", 500)
|
http.Error(w, "internal server error", 500)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user