Make error more explicit

This commit is contained in:
Frank Denis 2023-08-11 12:07:13 +02:00
parent d8aec47a72
commit c3dd761b81
1 changed files with 7 additions and 1 deletions

View File

@ -462,7 +462,13 @@ func (xTransport *XTransport) resolveAndUpdateCache(host string) error {
}
}
if foundIP == nil {
dlog.Errorf("no IP address found for [%s]", host)
if !xTransport.useIPv4 && xTransport.useIPv6 {
dlog.Warnf("no IPv6 address found for [%s]", host)
} else if xTransport.useIPv4 && !xTransport.useIPv6 {
dlog.Warnf("no IPv4 address found for [%s]", host)
} else {
dlog.Errorf("no IP address found for [%s]", host)
}
}
xTransport.saveCachedIP(host, foundIP, ttl)
dlog.Debugf("[%s] IP address [%s] added to the cache, valid for %v", host, foundIP, ttl)