From 0f71305ee12c352345df106bac4a959800ccb0ba Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Tue, 21 Feb 2017 22:15:20 +0100 Subject: [PATCH] refine log message --- proxy/http/server.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/proxy/http/server.go b/proxy/http/server.go index c4132ea0..e5185e6a 100644 --- a/proxy/http/server.go +++ b/proxy/http/server.go @@ -119,8 +119,7 @@ func (s *Server) handleConnect(ctx context.Context, request *http.Request, reade Close: false, } if err := response.Write(writer); err != nil { - log.Warning("HTTP|Server: failed to write back OK response: ", err) - return err + return errors.Base(err).Message("HTTP|Server: Failed to write back OK response.") } ctx, cancel := context.WithCancel(ctx) @@ -153,10 +152,9 @@ func (s *Server) handleConnect(ctx context.Context, request *http.Request, reade }) if err := signal.ErrorOrFinish2(ctx, requestDone, responseDone); err != nil { - log.Info("HTTP|Server: Connection ends with: ", err) ray.InboundInput().CloseError() ray.InboundOutput().CloseError() - return err + return errors.Base(err).Message("HTTP|Server: Connection ends.") } runtime.KeepAlive(timer) @@ -253,10 +251,9 @@ func (s *Server) handlePlainHTTP(ctx context.Context, request *http.Request, rea }) if err := signal.ErrorOrFinish2(ctx, requestDone, responseDone); err != nil { - log.Info("HTTP|Server: Connecton ending with ", err) input.CloseError() output.CloseError() - return err + return errors.Base(err).Message("HTTP|Server: Connection ends.") } return nil