chore: don't panic when set deadline error

This commit is contained in:
Larvan2 2024-02-21 21:00:33 +08:00
parent 1c7e011f87
commit 3d833ef6a8

View File

@ -709,7 +709,8 @@ func (doh *dnsOverHTTPS) tlsDial(ctx context.Context, dialContext dialHandler, n
err = conn.SetDeadline(time.Now().Add(dialTimeout))
if err != nil {
// Must not happen in normal circumstances.
panic(fmt.Errorf("cannot set deadline: %w", err))
log.Errorln("cannot set deadline: %v", err)
return nil, err
}
err = conn.Handshake()