diff --git a/internal/http/web_handlers.go b/internal/http/web_handlers.go index 6368197..648e4e4 100644 --- a/internal/http/web_handlers.go +++ b/internal/http/web_handlers.go @@ -143,12 +143,13 @@ func (h *Handlers) Guestbook(w http.ResponseWriter, r *http.Request) { func (h *Handlers) GuestbookAdmin(w http.ResponseWriter, r *http.Request) { entriesCount, _ := h.guestbookDB.Count() entries, err := h.guestbookDB.Entries(1, entriesCount) + if err != nil { + Error(w, http.StatusInternalServerError, err.Error(), "cannot load gb") + return + } for _, entry := range entries { entry.Message = strings.ReplaceAll(entry.Message, "\\n", "\n") } - if err != nil { - return - } web.GuestbookAdmin("/ Guestbook Administration", h.guestbookOwner, entries, r, w) }