lib/net/ssh/multi/session.rb in net-ssh-multi-1.0.0 vs lib/net/ssh/multi/session.rb in net-ssh-multi-1.0.1

- old
+ new

@@ -217,11 +217,11 @@ raise ArgumentError, "must provide group mapping OR block, not both" elsif block_given? begin saved_groups = open_groups.dup open_groups.concat(args.map { |a| a.to_sym }).uniq! - yield self if block_given? + yield self ensure open_groups.replace(saved_groups) end else mapping.each do |key, value| @@ -479,11 +479,16 @@ @open_connections += 1 end begin server.new_session - rescue Exception => e + + # I don't understand why this should be necessary--StandardError is a + # subclass of Exception, after all--but without explicitly rescuing + # StandardError, things like Errno::* and SocketError don't get caught + # here! + rescue Exception, StandardError => e server.fail! @session_mutex.synchronize { @open_connections -= 1 } case on_error when :ignore then @@ -541,6 +546,6 @@ session.replace_with(next_session(session.server, true)) end end end end -end; end; end \ No newline at end of file +end; end; end