summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJamis Buck <jamis@37signals.com>2008-09-16 08:40:41 -0600
committerJamis Buck <jamis@37signals.com>2008-09-16 08:40:41 -0600
commitc603ee4abb30fb6861939b5b3eef895b8f952665 (patch)
treeb4e587981f9e04bab585923fe5d966d816d1cf90
parent90757310038d4e2b0e54fd11ab0f2ccc01f6e04e (diff)
downloadnet-ssh-multi-c603ee4abb30fb6861939b5b3eef895b8f952665.tar.gz
explicitly rescue StandardError so that socket errors and errno exceptions get caught, too
-rw-r--r--lib/net/ssh/multi/session.rb7
1 files changed, 6 insertions, 1 deletions
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 }