diff options
author | elijah <elijah@riseup.net> | 2016-06-29 13:50:14 -0700 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2016-07-01 14:48:42 -0700 |
commit | 796b8893375adf3c178375e8f17f89f69f9f4fc8 (patch) | |
tree | 7d0f9703cdd2adafc48c1841c68ae42d7a538694 /lib/leap_cli/ssh | |
parent | 67c0610ee049a388d8ffd0a0e3912ee0d5d9a957 (diff) |
ssh remote command: reraise unknown exceptions
Diffstat (limited to 'lib/leap_cli/ssh')
-rw-r--r-- | lib/leap_cli/ssh/backend.rb | 5 |
1 files changed, 3 insertions, 2 deletions
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 |