Skip to content

Commit 0456d0d

Browse files
authored
fix(conn): connection errors (#26)
1 parent 745e505 commit 0456d0d

1 file changed

Lines changed: 4 additions & 14 deletions

File tree

pkg/util/quic.go

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import (
1414
"log"
1515
"math/big"
1616
"net"
17-
"strings"
1817
"time"
1918

2019
json "github.com/10cella/yomo-json-codec"
@@ -103,23 +102,14 @@ func QuicServer(endpoint string, plugin plugin.YomoObjectPlugin, codec *json.Cod
103102
for {
104103
sess, err := listener.Accept(context.Background())
105104
if err != nil {
106-
if strings.Index(err.Error(), "NO_ERROR") == 0 {
107-
log.Printf("Accept error: %s", err.Error())
108-
continue
109-
} else {
110-
panic(err)
111-
}
105+
log.Printf("Accept error: %s", err.Error())
106+
continue
112107
}
113108

114109
stream, err := sess.AcceptStream(context.Background())
115110
if err != nil {
116-
if strings.Index(err.Error(), "NO_ERROR") == 0 ||
117-
strings.Index(err.Error(), "PROTOCOL_VIOLATION") == 0 {
118-
log.Printf("AcceptStream error: %s", err.Error())
119-
continue
120-
} else {
121-
panic(err)
122-
}
111+
log.Printf("AcceptStream error: %s", err.Error())
112+
continue
123113
}
124114

125115
go io.Copy(YomoFrameworkStreamWriter{plugin.Name(), codec, plugin, stream}, stream) // nolint

0 commit comments

Comments
 (0)