Skip to content

Commit

Permalink
Added to handle panic golang#60029
Browse files Browse the repository at this point in the history
  • Loading branch information
Vasundhara committed May 7, 2023
1 parent 3e35df5 commit f3b375a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/net/lookup.go
Expand Up @@ -344,11 +344,14 @@ func (r *Resolver) lookupIPAddr(ctx context.Context, network, host string) ([]IP
} else {
go dnsWaitGroupDone(ch, lookupGroupCancel)
}
ctxErr := ctx.Err()
var err string
if ctxErr := mapErr(ctx.Err()); ctxErr != nil {
err = ctxErr.Error()
}
err := &DNSError{
Err: mapErr(ctxErr).Error(),
Err: err,
Name: host,
IsTimeout: ctxErr == context.DeadlineExceeded,
IsTimeout: ctxErr == errTimeout,
}
if trace != nil && trace.DNSDone != nil {
trace.DNSDone(nil, false, err)
Expand Down

0 comments on commit f3b375a

Please sign in to comment.