title: Twitter Gem - rescue's to consider?
body: <p>I'm working with the Twitter Gem and I've created a long running ruby task. I would like it to be able to handle common errors so I'm looking to build a list of those I should consider to protect against (for example the fail whale 500)</p>
  
  <p>Here is the begin/end loop my code functions in:</p>
  
  <pre><code>Begin
  
  # My (omitted) very long ruby task
  # filled with Twitter API requests
  
  rescue Errno::ENOENT
    sleep(5)
    logger.info "ENOENT error - attempting to retry"
    retry
  rescue Errno::ETIMEDOUT
    sleep(5)
    logger.info " Operation timed out - attempting to retry"
    retry
  rescue Errno::ECONNRESET
    sleep(5)
    logger.info "Connection reset by peer - attempting to retry"
    retry
  end 
  </code></pre>
  
  <p>Can you think of any other Errors to protect and retry against? Is this a well structured way to handle errors? What are some design implementations I should consider?</p>