diff --git a/dns-discovery/src/main/kotlin/org/apache/tuweni/discovery/DNSResolver.kt b/dns-discovery/src/main/kotlin/org/apache/tuweni/discovery/DNSResolver.kt index 30d9659c4..cab8d4aae 100644 --- a/dns-discovery/src/main/kotlin/org/apache/tuweni/discovery/DNSResolver.kt +++ b/dns-discovery/src/main/kotlin/org/apache/tuweni/discovery/DNSResolver.kt @@ -19,6 +19,7 @@ package org.apache.tuweni.discovery */ import io.vertx.core.Vertx +import io.vertx.core.VertxException import io.vertx.core.dns.DnsClient import io.vertx.core.dns.DnsClientOptions import io.vertx.core.dns.DnsException @@ -31,6 +32,7 @@ import org.apache.tuweni.crypto.SECP256K1 import org.apache.tuweni.devp2p.EthereumNodeRecord import org.slf4j.LoggerFactory import java.io.IOException +import java.lang.Exception /** * Resolves a set of ENR nodes from a host name. @@ -158,6 +160,13 @@ class DNSResolver @JvmOverloads constructor( } catch (e: IOException) { logger.warn("I/O exception contacting remote DNS server when resolving $domainName", e) return null + } catch (e: VertxException) { + // timeouts are common + logger.warn("Vertx exception contacting remote DNS server when resolving $domainName", e) + return null + } catch (e: Exception) { + logger.warn("Exception contacting remote DNS server when resolving $domainName", e) + return null } }