Properly catch connection refused error when installing plugin.

Fixes #7447
This commit is contained in:
Christoph Wurm 2017-06-13 13:54:42 -07:00 committed by Pier-Hugues Pellerin
parent aadb1ef007
commit beb371e79f

View file

@ -36,10 +36,10 @@ module LogStash module PluginManager module PackFetchStrategy
PluginManager.ui.debug("Package not found at: #{uri}") PluginManager.ui.debug("Package not found at: #{uri}")
return nil return nil
end end
rescue SocketError => e rescue SocketError, Errno::ECONNREFUSED, Errno::EHOSTUNREACH => e
# This probably means there is a firewall in place of the proxy is not correctly configured. # This probably means there is a firewall in place of the proxy is not correctly configured.
# So lets skip this strategy but log a meaningful errors. # So lets skip this strategy but log a meaningful errors.
PluginManager.ui.debug("SocketError, skipping Elastic pack, exception: #{e}") PluginManager.ui.debug("Network error, skipping Elastic pack, exception: #{e}")
return nil return nil
end end