github.com/arieschain/arieschain@v0.0.0-20191023063405-37c074544356/p2p/netutil/error.go (about)

     1  package netutil
     2  
     3  // IsTemporaryError checks whether the given error should be considered temporary.
     4  func IsTemporaryError(err error) bool {
     5  	tempErr, ok := err.(interface {
     6  		Temporary() bool
     7  	})
     8  	return ok && tempErr.Temporary() || isPacketTooBig(err)
     9  }