identity-service/internal/app/handler/error.go

16 lines
463 B
Go
Raw Normal View History

2022-06-19 15:19:05 +02:00
package handler
import "net/http"
type NotFoundHandler struct{}
func (NotFoundHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
encodeResponse(w, &response{http.StatusNotFound, "Path " + r.RequestURI + " not found"}, nil)
}
type MethodNotAllowedHandler struct{}
func (MethodNotAllowedHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
encodeResponse(w, &response{http.StatusMethodNotAllowed, "Method Not Allowed: " + r.Method}, nil)
}