Skip to content
Permalink
Browse files
Don't panic on failure to connect to host
  • Loading branch information
geomacy committed Jul 4, 2017
1 parent 749057b commit fffaec0635c2f0549b07c2237360a110834241ca
Showing 1 changed file with 6 additions and 0 deletions.
@@ -29,6 +29,8 @@ import (
"os"
"path/filepath"
"crypto/tls"
"net"
"time"
)

type Network struct {
@@ -238,5 +240,9 @@ func VerifyLoginURL(network *Network) error {
if url.Host == "" {
return errors.New("Use login command to set Brooklyn URL with a valid host[:port]")
}
_, err = net.DialTimeout("tcp", url.Host, time.Duration(30) * time.Second)
if err != nil {
return errors.New("Could not connect to " + url.Host)
}
return nil
}

0 comments on commit fffaec0

Please sign in to comment.