fix(tunnel): display friendly error on connect issues

Fixes: #686
pull/863/head
Adam Reese 9 years ago
parent 0acbcdd5cc
commit d300a08915

@ -66,16 +66,17 @@ func (c *Client) ForwardPort(namespace, podName string, remote int) (*Tunnel, er
return nil, err return nil, err
} }
errChan := make(chan error)
go func() { go func() {
if err := pf.ForwardPorts(); err != nil { errChan <- pf.ForwardPorts()
fmt.Printf("Error forwarding ports: %v\n", err)
}
}() }()
// wait for listeners to start select {
<-pf.Ready case err = <-errChan:
return t, fmt.Errorf("Error forwarding ports: %v\n", err)
return t, nil case <-pf.Ready:
return t, nil
}
} }
func getAvailablePort() (int, error) { func getAvailablePort() (int, error) {

Loading…
Cancel
Save