title: Refactor: Executing a block of code only if a there is no exception thrown
body: <p>I've got a section of code that I would like to run only if the previous block of code doesn't throw an error. I've implemented a solution that seems hacky and I'm sure there is a better way to do it in Ruby.</p>
  
  <p>Here's what I have so far:</p>
  
  <pre><code>existing_comments = Comment.all
  catch(:creation_failure) do
      begin
          ActiveRecord::Base.transaction do
              results.each do |row|
                  Comment.create!(row)
              end
          end
      rescue
          throw(:creation_failure)
      end
      existing_comments.destroy_all
  end
  </code></pre>
  
  <p>There's gotta be a better way to do this.</p>