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
@@ -22,7 +22,7 @@ import (
"io/ioutil"
"net/http"
"github.com/BBVA/kapow/internal/server/srverrors"
"github.com/BBVA/kapow/internal/server/httperror"
)
// Reason returns the reason phrase embedded within the JSON error
@@ -33,7 +33,7 @@ func Reason(r *http.Response) (string, error) {
return "", errors.New("error reading response's body")
}
reason := &srverrors.ServerErrMessage{}
reason := &httperror.ServerErrMessage{}
err = json.Unmarshal(body, reason)
if err != nil {
return "", errors.New("error unmarshaling JSON")