1
0
mirror of https://github.com/schollz/croc.git synced 2024-11-23 23:54:17 +03:00

don't show error on 1005

This commit is contained in:
Zack Scholl 2018-09-21 21:40:39 -07:00
parent 24493cf7f5
commit b6b6b754c9
3 changed files with 3 additions and 3 deletions

View File

@ -95,7 +95,7 @@ func (c *Croc) Receive(codephrase string) (err error) {
log.Debug(errDiscover)
}
if len(discovered) > 0 {
log.Debugf("discovered %s on %s", discovered[0].Payload, discovered[0].Address)
log.Debugf("discovered %s:%s", discovered[0].Address, discovered[0].Payload)
errChan <- c.sendReceive(fmt.Sprintf("ws://%s:%s", discovered[0].Address, discovered[0].Payload), "", codephrase, false)
} else {
log.Debug("discovered no peers")

View File

@ -28,7 +28,7 @@ func Receive(done chan struct{}, c *websocket.Conn, codephrase string) {
logger.SetLogLevel(DebugLevel)
err := receive(c, codephrase)
if err != nil {
if strings.HasPrefix(err.Error(), "websocket: close 1005") {
if strings.HasPrefix(err.Error(), "websocket: close 100") {
return
}
log.Error(err)

View File

@ -30,7 +30,7 @@ func Send(done chan struct{}, c *websocket.Conn, fname string, codephrase string
log.Debugf("sending %s", fname)
err := send(c, fname, codephrase)
if err != nil {
if strings.HasPrefix(err.Error(), "websocket: close 1005") {
if strings.HasPrefix(err.Error(), "websocket: close 100") {
return
}
log.Error(err)