Skip to content

Commit 95b92a7

Browse files
author
watsonian
committed
Rescue Timeout::Error so :on_error works as expected when server is unavailable.
1 parent c0b0a0b commit 95b92a7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/net/ssh/multi/server.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,8 @@ def new_session #:nodoc:
187187

188188
session[:server] = self
189189
session
190+
rescue ::Timeout::Error => error
191+
raise Net::SSH::ConnectionTimeout.new("#{error.message} for #{host}")
190192
rescue Net::SSH::AuthenticationFailed => error
191193
raise Net::SSH::AuthenticationFailed.new("#{error.message}@#{host}")
192194
end

0 commit comments

Comments
 (0)