diff --git a/broker/http_broker.go b/broker/http_broker.go index 2ad8ed0a..98abac97 100644 --- a/broker/http_broker.go +++ b/broker/http_broker.go @@ -286,7 +286,7 @@ func (h *httpBroker) ServeHTTP(w http.ResponseWriter, req *http.Request) { b, err := ioutil.ReadAll(req.Body) if err != nil { - errr := errors.InternalServerError("go.micro.broker", fmt.Sprintf("Error reading request body: %v", err)) + errr := errors.InternalServerError("go.micro.broker", "Error reading request body: %v", err) w.WriteHeader(500) w.Write([]byte(errr.Error())) return @@ -294,7 +294,7 @@ func (h *httpBroker) ServeHTTP(w http.ResponseWriter, req *http.Request) { var m *Message if err = h.opts.Codec.Unmarshal(b, &m); err != nil { - errr := errors.InternalServerError("go.micro.broker", fmt.Sprintf("Error parsing request body: %v", err)) + errr := errors.InternalServerError("go.micro.broker", "Error parsing request body: %v", err) w.WriteHeader(500) w.Write([]byte(errr.Error())) return diff --git a/client/rpc_client.go b/client/rpc_client.go index cc4078bd..aa157bad 100644 --- a/client/rpc_client.go +++ b/client/rpc_client.go @@ -78,7 +78,7 @@ func (r *rpcClient) call(ctx context.Context, address string, req Request, resp var grr error c, err := r.pool.getConn(address, r.opts.Transport, transport.WithTimeout(opts.DialTimeout)) if err != nil { - return errors.InternalServerError("go.micro.client", fmt.Sprintf("connection error: %v", err)) + return errors.InternalServerError("go.micro.client", "connection error: %v", err) } defer func() { // defer execution of release @@ -98,7 +98,7 @@ func (r *rpcClient) call(ctx context.Context, address string, req Request, resp go func() { defer func() { if r := recover(); r != nil { - ch <- errors.InternalServerError("go.micro.client", fmt.Sprintf("panic recovered: %v", r)) + ch <- errors.InternalServerError("go.micro.client", "panic recovered: %v", r) } }() @@ -154,7 +154,7 @@ func (r *rpcClient) stream(ctx context.Context, address string, req Request, opt c, err := r.opts.Transport.Dial(address, transport.WithStream(), transport.WithTimeout(opts.DialTimeout)) if err != nil { - return nil, errors.InternalServerError("go.micro.client", fmt.Sprintf("connection error: %v", err)) + return nil, errors.InternalServerError("go.micro.client", "connection error: %v", err) } stream := &rpcStream{