Skip to content

Commit 41faacf

Browse files
committed
pan: return pan error type HostNotFoundError
return pan error type HostNotFoundError in dnsResolver when no host is found
1 parent adf0e36 commit 41faacf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/pan/dns_txt.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func queryTXTRecord(ctx context.Context, host string) (addresses []string, err e
5353
var errDNSError *net.DNSError
5454
if errors.As(err, &errDNSError) {
5555
if errDNSError.IsNotFound {
56-
return addresses, err
56+
return addresses, HostNotFoundError{Host: host}
5757
}
5858
}
5959
if err != nil {
@@ -65,7 +65,7 @@ func queryTXTRecord(ctx context.Context, host string) (addresses []string, err e
6565
}
6666
}
6767
if len(addresses) == 0 {
68-
return addresses, err
68+
return addresses, HostNotFoundError{Host: host}
6969
}
7070
return addresses, nil
7171
}

0 commit comments

Comments
 (0)