Skip to content
This repository was archived by the owner on Aug 23, 2023. It is now read-only.

Commit

Permalink
simplify error msgs
Browse files Browse the repository at this point in the history
  • Loading branch information
replay committed May 22, 2018
1 parent 1fa6aaa commit 3c01e69
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions stats/out_graphite.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,19 +132,19 @@ func (g *Graphite) checkEOF(conn net.Conn) {
for {
num, err := conn.Read(b)
if err == io.EOF {
log.Info("checkEOF conn.Read returned EOF -> conn is closed. closing conn explicitly")
log.Info("Graphite.checkEOF: remote closed conn. closing conn")
conn.Close()
return
}

// just in case i misunderstand something or the remote behaves badly
if num != 0 {
log.Info("checkEOF conn.Read data? did not expect that. data: %s\n", b[:num])
log.Warn("Graphite.checkEOF: read unexpected data from peer: %s\n", b[:num])
continue
}

if err != io.EOF {
log.Warn("checkEOF conn.Read returned err != EOF, which is unexpected. closing conn. error: %s\n", err)
log.Warn("Graphite.checkEOF: %s\n", err)
conn.Close()
return
}
Expand Down

0 comments on commit 3c01e69

Please sign in to comment.