Skip to content

Commit

Permalink
chore: don't panic when set deadline error
Browse files Browse the repository at this point in the history
  • Loading branch information
Larvan2 committed Feb 21, 2024
1 parent 1c7e011 commit 3d833ef
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dns/doh.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 3d833ef

Please sign in to comment.