added error logging
All checks were successful
build and deploy kleinTodo / build (push) Successful in 11s
All checks were successful
build and deploy kleinTodo / build (push) Successful in 11s
This commit is contained in:
parent
4a402c5f8d
commit
298c5bbaeb
@ -2,6 +2,7 @@ package handler
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"log"
|
"log"
|
||||||
|
"log/slog"
|
||||||
"net/http"
|
"net/http"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -22,7 +23,6 @@ func UnprocessableEntityHandler(w http.ResponseWriter, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func UnauthorizedHandler(w http.ResponseWriter) {
|
func UnauthorizedHandler(w http.ResponseWriter) {
|
||||||
log.Println("unauthorized")
|
|
||||||
setError(w, http.StatusUnauthorized, "Unauthorized")
|
setError(w, http.StatusUnauthorized, "Unauthorized")
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -56,6 +56,7 @@ func handleError(w http.ResponseWriter, status int, err error) bool {
|
|||||||
default:
|
default:
|
||||||
InternalServerErrorHandler(w, err)
|
InternalServerErrorHandler(w, err)
|
||||||
}
|
}
|
||||||
|
slog.Error(err.Error())
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user