diff --git a/backend/blog.go b/backend/blog.go index 5c17b0a..a656a0c 100644 --- a/backend/blog.go +++ b/backend/blog.go @@ -293,7 +293,11 @@ func (h *ApiHandler) ServeBlogPatch(writer http.ResponseWriter, request *http.Re article.Id = id err = h.db.UpdateBlogArticle(article) if err != nil { - WriteError(writer, http.StatusInternalServerError, "failed to write database", err) + if errors.Is(err, ErrNotFound) { + WriteError(writer, http.StatusNotFound, "article not found", nil) + } else { + WriteError(writer, http.StatusInternalServerError, "failed to write database", err) + } return }