Skip to content

Commit bc6f5ea

Browse files
committed
rescue Object to make sure we cover everything. Also, shutdown! not terminate!
For some reason, "rescue Exception" doesn't rescue StandardError. Strange, but true.
1 parent e401c03 commit bc6f5ea

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/net/sftp.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ def self.start(host, user, options={}, &block)
3838
end
3939

4040
sftp
41-
rescue Exception => anything
41+
rescue Object => anything
4242
begin
43-
session.terminate!
43+
session.shutdown!
4444
rescue Exception
4545
# swallow exceptions that occur while trying to shutdown
4646
end

0 commit comments

Comments
 (0)