lib/httpx/resolver/resolver.rb in httpx-0.24.7 vs lib/httpx/resolver/resolver.rb in httpx-1.0.0
- old
+ new
@@ -93,10 +93,10 @@
def emit_resolve_error(connection, hostname = connection.origin.host, ex = nil)
emit(:error, connection, resolve_error(hostname, ex))
end
def resolve_error(hostname, ex = nil)
- return ex if ex.is_a?(ResolveError)
+ return ex if ex.is_a?(ResolveError) || ex.is_a?(ResolveTimeoutError)
message = ex ? ex.message : "Can't resolve #{hostname}"
error = ResolveError.new(message)
error.set_backtrace(ex ? ex.backtrace : caller)
error