diff --git a/command/agent/http.go b/command/agent/http.go index b66262aa6d..6bdd1916f6 100644 --- a/command/agent/http.go +++ b/command/agent/http.go @@ -77,7 +77,7 @@ func (s *HTTPServer) wrap(handler func(resp http.ResponseWriter, req *http.Reque // Check for an error HAS_ERR: if err != nil { - s.logger.Printf("[ERR] Request %v, error: %v", req, err) + s.logger.Printf("[ERR] Request %v, error: %v", req.URL, err) resp.WriteHeader(500) resp.Write([]byte(err.Error())) return diff --git a/consul/pool.go b/consul/pool.go index 3a4ae502a8..c4e96c48e1 100644 --- a/consul/pool.go +++ b/consul/pool.go @@ -1,6 +1,7 @@ package consul import ( + "fmt" "github.com/ugorji/go/codec" "net" "net/rpc" @@ -161,7 +162,7 @@ func (p *ConnPool) RPC(addr net.Addr, method string, args interface{}, reply int // Try to get a conn first conn, err := p.Acquire(addr) if err != nil { - return err + return fmt.Errorf("failed to get conn: %v", err) } // Make the RPC call @@ -179,7 +180,7 @@ func (p *ConnPool) RPC(addr net.Addr, method string, args interface{}, reply int } else { conn.Close() } - return err + return fmt.Errorf("rpc error: %v", err) } // Reap is used to close conns open over maxTime