title: Rails 5 throw abort : how do I setup error messages?
body: <p>Rails has introduced this <code>throw(:abort)</code> syntax, but now how do I get meaningful destroy errors ?</p>
  
  <p>For validation errors one would do</p>
  
  <pre><code>if not user.save
    # =&gt; user.errors has information
  
  if not user.destroy
    # =&gt; user.errors is empty
  </code></pre>
  
  <p>Here is my model</p>
  
  <pre><code>class User
  
    before_destroy :destroy_validation,
      if: :some_reason
  
    private
  
    def destroy_validation
      throw(:abort) if some_condition
    end
  </code></pre>