Skip to content

Commit

Permalink
fix: skip logging ErrClosed
Browse files Browse the repository at this point in the history
  • Loading branch information
pancsta authored and cenkalti committed Sep 15, 2024
1 parent 1077830 commit ff2a9be
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion server.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package rpc2

import (
"errors"
"io"
"log"
"net"
Expand Down Expand Up @@ -142,7 +143,9 @@ func (s *Server) Accept(lis net.Listener) {
for {
conn, err := lis.Accept()
if err != nil {
log.Print("rpc.Serve: accept:", err.Error())
if !errors.Is(err, net.ErrClosed) {
log.Print("rpc.Serve: accept:", err.Error())
}
return
}
go s.ServeConn(conn)
Expand Down

0 comments on commit ff2a9be

Please sign in to comment.