Also catch network unreachable for connection to host and gateway and timeout for gateway:

Host: 172.22.150.6
Connecting to host 172.22.150.6 (user: root, port: 22)...
/usr/lib/ruby/vendor_ruby/net/ssh/transport/session.rb:67:in `initialize': Network is unreachable - connect(2) for "172.22.150.6" port 22 (Errno::ENETUNREACH)
        from /usr/lib/ruby/vendor_ruby/net/ssh/transport/session.rb:67:in `open'
        from /usr/lib/ruby/vendor_ruby/net/ssh/transport/session.rb:67:in `block in initialize'
        from /usr/lib/ruby/2.1.0/timeout.rb:76:in `timeout'
        from /usr/lib/ruby/2.1.0/timeout.rb:127:in `timeout'
        from /usr/lib/ruby/vendor_ruby/net/ssh/transport/session.rb:67:in `initialize'
        from /usr/lib/ruby/vendor_ruby/net/ssh.rb:192:in `new'
        from /usr/lib/ruby/vendor_ruby/net/ssh.rb:192:in `start'
        from /usr/bin/distkeys:314:in `connect'
        from /usr/bin/distkeys:565:in `handle_host'
        from /usr/bin/distkeys:697:in `block in handle_gwhost'
        from /usr/bin/distkeys:680:in `each'
        from /usr/bin/distkeys:680:in `handle_gwhost'
        from /usr/bin/distkeys:712:in `loop'
        from /usr/bin/distkeys:822:in `<main>'