mirror of https://github.com/hashicorp/consul
porter: add better warning if missing
parent
9dec64dd17
commit
86901b887d
|
@ -6,6 +6,7 @@ import (
|
|||
"io/ioutil"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
var DefaultAddr = "127.0.0.1:7965"
|
||||
|
@ -23,6 +24,9 @@ func RandomPorts(n int) ([]int, error) {
|
|||
}
|
||||
resp, err := http.Get(fmt.Sprintf("http://%s/%d", addr, n))
|
||||
if err != nil {
|
||||
if strings.Contains(err.Error(), "connection refused") {
|
||||
return nil, fmt.Errorf("Are you running porter?\nInstall with 'go install github.com/hashicorp/consul/test/porter/cmd/porter'\nThen run 'porter go test ...'\n%s", err)
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
|
Loading…
Reference in New Issue