From c603ee4abb30fb6861939b5b3eef895b8f952665 Mon Sep 17 00:00:00 2001 From: Jamis Buck Date: Tue, 16 Sep 2008 08:40:41 -0600 Subject: explicitly rescue StandardError so that socket errors and errno exceptions get caught, too --- lib/net/ssh/multi/session.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/net/ssh/multi/session.rb b/lib/net/ssh/multi/session.rb index 957533a..40af774 100644 --- a/lib/net/ssh/multi/session.rb +++ b/lib/net/ssh/multi/session.rb @@ -481,7 +481,12 @@ module Net; module SSH; module Multi 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 } -- cgit v1.2.1