Skip to content

Commit

Permalink
Rescue the error when connection timed-out
Browse files Browse the repository at this point in the history
Addressing:
net/ssh/transport/session.rb:70:in `initialize': Connection timed out - connect(2) (Errno::ETIMEDOUT)

Auditing the SCP gem and dependencies, I see a lot of potential
exceptions that may occur: Net::SCP::Error, Net::SSH::Exception,
SystemCallError, SocketError and perhaps more. They all have one common
superclass that is StandardError.

https://bugzilla.redhat.com/show_bug.cgi?id=1321107
  • Loading branch information
isimluk committed Apr 9, 2016
1 parent 3468f11 commit 2b74db8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gems/pending/appliance_console/key_configuration.rb
Expand Up @@ -83,7 +83,7 @@ def fetch_key
scp.download!(key_path, KEY_FILE)
end
File.exist?(KEY_FILE)
rescue Net::SSH::AuthenticationFailed, SocketError => e
rescue => e
say("Failed to fetch key: #{e.message}")
false
end
Expand Down

0 comments on commit 2b74db8

Please sign in to comment.