From 0aa6651fabcdbfa2dca836ef761ffe5fe023a96f Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Sat, 6 May 2023 23:09:25 +0400 Subject: [PATCH] Error handlers was made into independent funcs. --- internal/http/handlers.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/http/handlers.go b/internal/http/handlers.go index a170cc9..2e24d48 100644 --- a/internal/http/handlers.go +++ b/internal/http/handlers.go @@ -259,17 +259,17 @@ func (h *Handlers) Robots(w http.ResponseWriter, r *http.Request) { /**** Errors ******************************************************************/ -func (h *Handlers) ForbiddenError(err, msg string, w http.ResponseWriter) { +func ForbiddenError(err, msg string, w http.ResponseWriter) { w.WriteHeader(http.StatusForbidden) web.ForbiddenError("/ Forbidden", err, msg, w) } -func (h *Handlers) NotFound(w http.ResponseWriter, r *http.Request) { +func NotFound(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusNotFound) web.NotFound("Not Found", w) } -func (h *Handlers) InternalError(err, msg string, w http.ResponseWriter) { +func InternalError(err, msg string, w http.ResponseWriter) { w.WriteHeader(http.StatusInternalServerError) web.InternalError("/ Internal Error", err, msg, w) }