1
0

Error handlers was made into independent funcs.

This commit is contained in:
Alexander Andreev 2023-05-06 23:09:25 +04:00
parent 02ebed9cef
commit 0aa6651fab
Signed by: Arav
GPG Key ID: D22A817D95815393

View File

@ -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)
}