title: Ruby/Rails break out of method inside loop
body: <p>I have two methods I use to sync categories to a 3rd party service.  The first method loops through everything and the second actually exports each category. If there is a failure, how do I break out of the loop completely?</p>
  
  <pre><code>def export_all
    Category.find_each do |c|
      export_category(c)
    end
  end
  
  def export_category(c)
    begin
      sync_category(c)
    rescue Exception =&gt; e
      # break out of `export_all` loop
    end
  end
  </code></pre>