1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

api: Don't include stack traces with errors

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
This commit is contained in:
Aaron Lehmann 2017-04-05 16:59:32 -07:00
parent 945a119c8a
commit 7381fffb2f

View file

@ -139,11 +139,9 @@ func (s *Server) makeHTTPHandler(handler httputils.APIFunc) http.HandlerFunc {
if err := handlerFunc(ctx, w, r, vars); err != nil { if err := handlerFunc(ctx, w, r, vars); err != nil {
statusCode := httputils.GetHTTPErrorStatusCode(err) statusCode := httputils.GetHTTPErrorStatusCode(err)
errFormat := "%v" if statusCode >= 500 {
if statusCode == http.StatusInternalServerError { logrus.Errorf("Handler for %s %s returned error: %v", r.Method, r.URL.Path, err)
errFormat = "%+v"
} }
logrus.Errorf("Handler for %s %s returned error: "+errFormat, r.Method, r.URL.Path, err)
httputils.MakeErrorHandler(err)(w, r) httputils.MakeErrorHandler(err)(w, r)
} }
} }