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:
pancho horrillo
2019-11-20 07:49:38 +01:00
parent 0d66fe9963
commit 206aac5747
9 changed files with 77 additions and 77 deletions
+2 -2
View File
@@ -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
}