Log connect error only in wavefront output (#3549)

This commit is contained in:
Daniel Nelson 2017-12-06 14:55:29 -08:00 committed by GitHub
parent d8966d5067
commit 177e7e2c73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -101,11 +101,13 @@ func (w *Wavefront) Connect() error {
uri := fmt.Sprintf("%s:%d", w.Host, w.Port)
_, err := net.ResolveTCPAddr("tcp", uri)
if err != nil {
return fmt.Errorf("Wavefront: TCP address cannot be resolved %s", err.Error())
log.Printf("Wavefront: TCP address cannot be resolved %s", err.Error())
return nil
}
connection, err := net.Dial("tcp", uri)
if err != nil {
return fmt.Errorf("Wavefront: TCP connect fail %s", err.Error())
log.Printf("Wavefront: TCP connect fail %s", err.Error())
return nil
}
defer connection.Close()
return nil