identity-service/src/internal/app/handler/error.go
Piotr Biernat dc58c80074
Some checks failed
continuous-integration/drone/push Build is failing
ci/cd test
2022-10-06 20:10:05 +02:00

19 lines
494 B
Go

package handler
import (
"errors"
"net/http"
)
type NotFoundHandler struct{}
func (NotFoundHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
encodeResponse(w, &response{http.StatusNotFound, ""}, errors.New("Path "+r.RequestURI+" not found"))
}
type MethodNotAllowedHandler struct{}
func (MethodNotAllowedHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
encodeResponse(w, &response{http.StatusMethodNotAllowed, ""}, errors.New("Method Not Allowed: "+r.Method))
}