Skip to content

Commit

Permalink
Raise ResolvError if no hostnames were found
Browse files Browse the repository at this point in the history
  • Loading branch information
carlhoerberg committed Mar 20, 2021
1 parent 5cfec59 commit b3d3f89
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/excon/socket.rb
Expand Up @@ -107,7 +107,7 @@ def connect
family = @data[:proxy][:family]
end

::Resolv.each_address(hostname) do |ip|
Resolv.each_address(hostname) do |ip|
# already succeeded on previous addrinfo
if @socket
break
Expand Down Expand Up @@ -150,6 +150,8 @@ def connect
end
end

exception ||= Resolv::ResolvError.new("no address for #{hostname}")

# this will be our last encountered exception
fail exception unless @socket

Expand Down

0 comments on commit b3d3f89

Please sign in to comment.