Log if connection is closed on write error

This commit is contained in:
Daniel Nelson 2018-05-29 16:10:27 -07:00
parent c8b68430f0
commit 59f0a5354f
No known key found for this signature in database
GPG Key ID: CAAD59C9444F6155
1 changed files with 1 additions and 0 deletions

View File

@ -137,6 +137,7 @@ func (sw *SocketWriter) Write(metrics []telegraf.Metric) error {
// permanent error. close the connection // permanent error. close the connection
sw.Close() sw.Close()
sw.Conn = nil sw.Conn = nil
return fmt.Errorf("closing connection: %v", err)
} }
return err return err
} }