Skip to content

Commit c603ee4

Browse files
committed
explicitly rescue StandardError so that socket errors and errno exceptions get caught, too
1 parent 9075731 commit c603ee4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/net/ssh/multi/session.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,12 @@ def next_session(server, force=false) #:nodoc:
481481

482482
begin
483483
server.new_session
484-
rescue Exception => e
484+
485+
# I don't understand why this should be necessary--StandardError is a
486+
# subclass of Exception, after all--but without explicitly rescuing
487+
# StandardError, things like Errno::* and SocketError don't get caught
488+
# here!
489+
rescue Exception, StandardError => e
485490
server.fail!
486491
@session_mutex.synchronize { @open_connections -= 1 }
487492

0 commit comments

Comments
 (0)