New error handling added to server and decorator module in data package
This commit is contained in:
@@ -20,6 +20,7 @@ import (
|
||||
"log"
|
||||
"net/http"
|
||||
|
||||
"github.com/BBVA/kapow/internal/server/srverrors"
|
||||
"github.com/gorilla/mux"
|
||||
)
|
||||
|
||||
@@ -36,7 +37,9 @@ func configRouter(rs []routeSpec) (r *mux.Router) {
|
||||
}
|
||||
r.HandleFunc(
|
||||
"/handlers/{handlerID}/{resource:.*}",
|
||||
func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusBadRequest) })
|
||||
func(w http.ResponseWriter, r *http.Request) {
|
||||
srverrors.WriteErrorResponse(http.StatusBadRequest, "Invalid Resource Path", w)
|
||||
})
|
||||
return r
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user