Error handlers was made into independent funcs.
This commit is contained in:
parent
02ebed9cef
commit
0aa6651fab
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user