handle errors in defer close

This commit is contained in:
2026-05-07 08:56:38 -06:00
parent c565a2d97a
commit 0eedf23667
3 changed files with 15 additions and 5 deletions
-2
View File
@@ -17,7 +17,6 @@ func (s *Server) handlerRefresh(w http.ResponseWriter, req *http.Request) {
respondWithError(w, http.StatusUnauthorized, "unauthorized")
return
}
defer req.Body.Close()
if err := s.c.Refresh(); err != nil {
slog.Error("refresh failed", "err", err)
@@ -37,7 +36,6 @@ func (s *Server) handlerLogLevel(w http.ResponseWriter, req *http.Request) {
respondWithError(w, http.StatusUnauthorized, "unauthorized")
return
}
defer req.Body.Close()
type reqParameters struct {
NewLevel string `json:"loglevel"`