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 }