diff --git a/pkg/util/quic.go b/pkg/util/quic.go index 4ac4edd72..117c5b19a 100644 --- a/pkg/util/quic.go +++ b/pkg/util/quic.go @@ -14,6 +14,7 @@ import ( "log" "math/big" "net" + "strings" "time" json "github.com/10cella/yomo-json-codec" @@ -102,11 +103,22 @@ func QuicServer(endpoint string, plugin plugin.YomoObjectPlugin, codec *json.Cod for { sess, err := listener.Accept(context.Background()) if err != nil { - panic(err) + if strings.Index(err.Error(), "NO_ERROR") == 0 { + log.Printf("Accept error: %s", err.Error()) + continue + } else { + panic(err) + } } + stream, err := sess.AcceptStream(context.Background()) if err != nil { - panic(err) + if strings.Index(err.Error(), "NO_ERROR") == 0 { + log.Printf("AcceptStream error: %s", err.Error()) + continue + } else { + panic(err) + } } go io.Copy(YomoFrameworkStreamWriter{plugin.Name(), codec, plugin, stream}, stream) // nolint