title: Ruby Net::SFTP transfer interrupt handling
body: <p>How to handle Ruby Net::SFTP transfer interruption like network disconnection?</p>
  
  <p>When I run my example code and the network is disconnected during the transfer, application stays running.</p>
  
  <pre><code>require 'net/sftp'
  
  Net::SFTP.start("testing","root",:timeout=&gt;1) do |sftp|
      begin
          sftp.download!("testfile_100MB", "testfile_100MB")
      rescue RuntimeError =&gt;e
          puts e.message
      end
  end
  </code></pre>