mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-12 13:31:52 +00:00
Update for the PR feedback
This commit is contained in:
parent
9c2705a5a2
commit
b557acf987
@ -141,9 +141,10 @@ func RecoverPanics(handler http.Handler, resolver *RequestInfoResolver) http.Han
|
|||||||
glog.Errorf("APIServer panic'd on %v %v: %v\n%s\n", req.Method, req.RequestURI, err, debug.Stack())
|
glog.Errorf("APIServer panic'd on %v %v: %v\n%s\n", req.Method, req.RequestURI, err, debug.Stack())
|
||||||
})
|
})
|
||||||
|
|
||||||
|
logger := httplog.NewLogged(req, &w)
|
||||||
requestInfo, err := resolver.GetRequestInfo(req)
|
requestInfo, err := resolver.GetRequestInfo(req)
|
||||||
if err != nil || requestInfo.Verb != "proxy" {
|
if err != nil || requestInfo.Verb != "proxy" {
|
||||||
defer httplog.NewLogged(req, &w).StacktraceWhen(
|
logger.StacktraceWhen(
|
||||||
httplog.StatusIsNot(
|
httplog.StatusIsNot(
|
||||||
http.StatusOK,
|
http.StatusOK,
|
||||||
http.StatusCreated,
|
http.StatusCreated,
|
||||||
@ -159,8 +160,9 @@ func RecoverPanics(handler http.Handler, resolver *RequestInfoResolver) http.Han
|
|||||||
errors.StatusUnprocessableEntity,
|
errors.StatusUnprocessableEntity,
|
||||||
http.StatusSwitchingProtocols,
|
http.StatusSwitchingProtocols,
|
||||||
),
|
),
|
||||||
).Log()
|
)
|
||||||
}
|
}
|
||||||
|
defer logger.Log()
|
||||||
// Dispatch to the internal handler
|
// Dispatch to the internal handler
|
||||||
handler.ServeHTTP(w, req)
|
handler.ServeHTTP(w, req)
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user