mirror of
https://github.com/m1k1o/neko.git
synced 2025-06-03 19:32:42 +02:00
refactor HTTP error.
This commit is contained in:
parent
d46c5d9d30
commit
4fa11e6a2a
15 changed files with 166 additions and 102 deletions
|
@ -28,7 +28,7 @@ func (api *ApiManagerCtx) Login(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
session, token, err := api.members.Login(data.Username, data.Password)
|
||||
if err != nil {
|
||||
utils.HttpUnauthorized(w, err)
|
||||
utils.HttpUnauthorized(w).WithInternalErr(err).Send()
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,7 @@ func (api *ApiManagerCtx) Logout(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
err := api.members.Logout(session.ID())
|
||||
if err != nil {
|
||||
utils.HttpUnauthorized(w, err)
|
||||
utils.HttpUnauthorized(w).WithInternalErr(err).Send()
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue