[feature] Merged with api-prototype
This commit is contained in:
15
internal/app/handler/error.go
Normal file
15
internal/app/handler/error.go
Normal file
@@ -0,0 +1,15 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user