title: Rails 3 - Rescuing a Mysql2::Error: Table doesn't exist
body: <p>I have an iteration in which I am calling <code>set_table_name</code> for some model. The idea is that in each iteration, the model changes its table. Sometimes, the table won't exist, in that case, an error of this kind will happen:</p>
  
  <pre><code>Mysql2::Error: Table 'db_name.table_name_xyz' doesn't exist
  </code></pre>
  
  <p>I want the iteration to keep running and not abort because of the error. I've wrapped the <code>set_table_name</code> line of code with a <code>begin</code> and <code>rescue</code>, but no exception seems to be raised as the script instantly aborts on error (it doesn't execute the <code>rescue</code> code). Here's the code:</p>
  
  <pre><code>((start_year)..(start_actual_year)).each do |year|
        begin
          Data.set_table_name("Secciones#{year}#{year + 1}")
        rescue Exception =&gt; e
          next
        end
  end
  </code></pre>
  
  <p>Can I rescue this kind of error? What should I do? Thanks!</p>