mirror of
https://github.com/schollz/croc.git
synced 2024-11-28 01:16:10 +03:00
don't show error on 1005
This commit is contained in:
parent
24493cf7f5
commit
b6b6b754c9
@ -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")
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user