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
@@ -19,8 +19,8 @@ package data
import (
"net/http"
"github.com/BBVA/kapow/internal/server/httperror"
"github.com/BBVA/kapow/internal/server/model"
"github.com/BBVA/kapow/internal/server/srverrors"
"github.com/gorilla/mux"
)
@@ -40,7 +40,7 @@ func checkHandler(fn resourceHandler) func(http.ResponseWriter, *http.Request) {
if h, ok := Handlers.Get(handlerID); ok {
fn(w, r, h)
} else {
srverrors.ErrorJSON(w, "Handler ID Not Found", http.StatusNotFound)
httperror.ErrorJSON(w, "Handler ID Not Found", http.StatusNotFound)
}
}
}