From 796b8893375adf3c178375e8f17f89f69f9f4fc8 Mon Sep 17 00:00:00 2001 From: elijah Date: Wed, 29 Jun 2016 13:50:14 -0700 Subject: ssh remote command: reraise unknown exceptions --- lib/leap_cli/ssh/backend.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/leap_cli') diff --git a/lib/leap_cli/ssh/backend.rb b/lib/leap_cli/ssh/backend.rb index 35277039..f42379cc 100644 --- a/lib/leap_cli/ssh/backend.rb +++ b/lib/leap_cli/ssh/backend.rb @@ -4,6 +4,7 @@ # common exceptions. # +require 'timeout' require 'sshkit' require 'leap_cli/ssh/formatter' require 'leap_cli/ssh/scripts' @@ -134,12 +135,12 @@ module LeapCli @logger.log(exc.to_s.strip, wrap: true) end end - elsif exc.is_a?(Timeout::Error) + elsif exc.is_a?(Timeout::Error) || exc.is_a?(Net::SSH::ConnectionTimeout) @logger.log(:failed, args.join(' '), host: @host.hostname) do @logger.log("Connection timed out") end else - @logger.log(:error, "unknown exception: " + exc.to_s) + raise end return nil end -- cgit v1.2.3