diff --git a/resolver-dns/src/main/java/io/netty/resolver/dns/DnsServerAddressStreamProviders.java b/resolver-dns/src/main/java/io/netty/resolver/dns/DnsServerAddressStreamProviders.java index f316091b71..8ba95777b8 100644 --- a/resolver-dns/src/main/java/io/netty/resolver/dns/DnsServerAddressStreamProviders.java +++ b/resolver-dns/src/main/java/io/netty/resolver/dns/DnsServerAddressStreamProviders.java @@ -66,10 +66,12 @@ public final class DnsServerAddressStreamProviders { } else { throw (Throwable) maybeProvider; } + } catch (ClassNotFoundException cause) { + LOGGER.warn("Can not find {} in the classpath, fallback to system defaults. This may result in " + + "incorrect DNS resolutions on MacOS.", MACOS_PROVIDER_CLASS_NAME); } catch (Throwable cause) { - LOGGER.warn( - "Unable to load {}, fallback to system defaults. {}", MACOS_PROVIDER_CLASS_NAME, - "This may result in incorrect DNS resolutions on MacOS.", cause); + LOGGER.error("Unable to load {}, fallback to system defaults. This may result in " + + "incorrect DNS resolutions on MacOS.", MACOS_PROVIDER_CLASS_NAME, cause); constructor = null; } }