lib/httpx/resolver/resolver_mixin.rb in httpx-0.16.1 vs lib/httpx/resolver/resolver_mixin.rb in httpx-0.17.0

- old
+ new

@@ -7,11 +7,11 @@ module Resolver module ResolverMixin include Callbacks include Loggable - CHECK_IF_IP = proc do |name| + CHECK_IF_IP = lambda do |name| begin IPAddr.new(name) true rescue ArgumentError false @@ -53,9 +53,10 @@ @system_resolver ||= Resolv::Hosts.new ips = @system_resolver.getaddresses(hostname) return if ips.empty? ips.map { |ip| IPAddr.new(ip) } + rescue IOError end def emit_resolve_error(connection, hostname = connection.origin.host, ex = nil) emit(:error, connection, resolve_error(hostname, ex)) end