title: adding model validation errors in rescue
body: <p>I have the following model with a virtual attribute </p>
  
  <pre><code>class Mytimeperiod &lt; ActiveRecord::Base
    validates presence of :from_dt
    validates_format_of :from_dt, :with =&gt; /\A\d{2}\/\d{2}\/\d{4}\Z/, :message =&gt; "format is mm/dd/yyyy"
  
    def from_dt
       self.from_date.strftime("%m/%d/%Y") if !self.from_date.blank?
    end
  
    def from_dt=(from_dt)
      self.from_date = Date.parse(from_dt)
    rescue
      self.errors.add_to_base("invalid from dt")
    end
  end
  </code></pre>
  
  <p>I am using <code>&lt;%= f.error_messages %&gt;</code> to display the error messages on the form.</p>
  
  <p>I am using from_dt as a virtual attribute (string). The 'presence of' and 'format of' validation errors show up on the form, but when the user enters an invalid date format on the form and Date.Parse raises an exception I have a 'errors.add_to_base' statement in the rescue clause. Can anyone tell me why this error does not show up in the form error messages when I disable the 'format of' validation.</p>
  
  <p>thanks. </p>