Rename package srverrors to httperror
- Package names are preferred to be in singular form¹. - Since errors are just for HTTP and not generic, I changed the base name to 'http'. - I didn't name it simply 'error', because it would then conflict with the - standard 'error' interface. ¹: https://rakyll.org/style-packages/
This commit is contained in:
@@ -20,7 +20,7 @@ import (
|
||||
"log"
|
||||
"net/http"
|
||||
|
||||
"github.com/BBVA/kapow/internal/server/srverrors"
|
||||
"github.com/BBVA/kapow/internal/server/httperror"
|
||||
"github.com/gorilla/mux"
|
||||
)
|
||||
|
||||
@@ -38,7 +38,7 @@ func configRouter(rs []routeSpec) (r *mux.Router) {
|
||||
r.HandleFunc(
|
||||
"/handlers/{handlerID}/{resource:.*}",
|
||||
func(w http.ResponseWriter, r *http.Request) {
|
||||
srverrors.ErrorJSON(w, "Invalid Resource Path", http.StatusBadRequest)
|
||||
httperror.ErrorJSON(w, "Invalid Resource Path", http.StatusBadRequest)
|
||||
})
|
||||
return r
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user