title: How to tell a connect timeout error from a read timeout error in Ruby's Net::HTTP
body: <p>My question is related to <a href="https://stackoverflow.com/questions/2370140/how-to-rescue-timeout-issues-ruby-rails">How to rescue timeout issues (Ruby, Rails)</a>.</p>
  
  <p>Here's the common way to rescue from a timeout:</p>
  
  <pre><code>def action
    # Post using Net::HTTP
  rescue Timeout::Error =&gt; e
    # Do something
  end
  </code></pre>
  
  <p>I'd like to determine if the exception was raised while trying to <strong>connect</strong> to the host, or if it was raised while trying to <strong>read</strong> from the host. Is this possible?</p>