From fe87114fe05526426308207bff65a9a964e26f68 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Sun, 24 Sep 2023 20:00:49 +0400 Subject: [PATCH] In Article HTTP handler a loging for web.GetArticle() was changed. --- internal/http/web_handlers.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/http/web_handlers.go b/internal/http/web_handlers.go index 0c3d8dc..ebdef91 100644 --- a/internal/http/web_handlers.go +++ b/internal/http/web_handlers.go @@ -103,9 +103,9 @@ func (h *Handlers) About(w http.ResponseWriter, r *http.Request) { func (h *Handlers) Article(w http.ResponseWriter, r *http.Request) { name := r.URL.Path[strings.LastIndex(r.URL.Path, "/")+1:] - artcl, err := web.GetArticle(name) - if err != nil { - http.Error(w, err.Error(), http.StatusNotFound) + artcl := web.GetArticle(name) + if artcl == nil { + http.Error(w, "an article doesn't exist", http.StatusNotFound) return }